Comments – wpDiscuz - Version 1.0.0

Version Description

Initial version

Download this release

Release Info

Developer AdvancedCoding
Plugin Icon 128x128 Comments – wpDiscuz
Version 1.0.0
Comparing to
See all releases

Version 1.0.0

Files changed (72) hide show
  1. captcha/captcha.php +33 -0
  2. captcha/captcha_bg_easy.png +0 -0
  3. captcha/consolai.ttf +0 -0
  4. comment-form/form.php +115 -0
  5. comment-form/tpl-comment.php +234 -0
  6. dto/wc-comment.php +55 -0
  7. files/css/fv.css +69 -0
  8. files/css/options-css.css +10 -0
  9. files/img/avatar_default.png +0 -0
  10. files/img/loader/ajax-loader-200x200.gif +0 -0
  11. files/img/loader/warning.png +0 -0
  12. files/img/plugin-icon/plugin-icon-20.png +0 -0
  13. files/img/plugin-icon/plugin-icon-48.png +0 -0
  14. files/img/refresh-16x16.png +0 -0
  15. files/img/refresh-32x32.png +0 -0
  16. files/img/social-icons/fb-18x18.png +0 -0
  17. files/img/social-icons/fb-24x24.png +0 -0
  18. files/img/social-icons/google-18x18.png +0 -0
  19. files/img/social-icons/google-24x24.png +0 -0
  20. files/img/social-icons/twitter-18x18.png +0 -0
  21. files/img/social-icons/twitter-24x24.png +0 -0
  22. files/img/x.png +0 -0
  23. files/js/jquery.autogrowtextarea.min.js +19 -0
  24. files/js/jquery.cookie.js +117 -0
  25. files/js/options-js.js +81 -0
  26. files/js/validator.js +392 -0
  27. files/js/wc-ajax.js +258 -0
  28. files/js/wc-scripts.js +41 -0
  29. files/third-party/colorpicker/css/colorpicker.css +161 -0
  30. files/third-party/colorpicker/img/blank.gif +0 -0
  31. files/third-party/colorpicker/img/colorpicker_background.png +0 -0
  32. files/third-party/colorpicker/img/colorpicker_hex.png +0 -0
  33. files/third-party/colorpicker/img/colorpicker_hsb_b.png +0 -0
  34. files/third-party/colorpicker/img/colorpicker_hsb_h.png +0 -0
  35. files/third-party/colorpicker/img/colorpicker_hsb_s.png +0 -0
  36. files/third-party/colorpicker/img/colorpicker_icon.jpg +0 -0
  37. files/third-party/colorpicker/img/colorpicker_icon_22.png +0 -0
  38. files/third-party/colorpicker/img/colorpicker_icon_256.png +0 -0
  39. files/third-party/colorpicker/img/colorpicker_icon_30.png +0 -0
  40. files/third-party/colorpicker/img/colorpicker_indic.gif +0 -0
  41. files/third-party/colorpicker/img/colorpicker_overlay.png +0 -0
  42. files/third-party/colorpicker/img/colorpicker_rgb_b.png +0 -0
  43. files/third-party/colorpicker/img/colorpicker_rgb_g.png +0 -0
  44. files/third-party/colorpicker/img/colorpicker_rgb_r.png +0 -0
  45. files/third-party/colorpicker/img/colorpicker_select.gif +0 -0
  46. files/third-party/colorpicker/img/colorpicker_submit.png +0 -0
  47. files/third-party/colorpicker/img/custom_background.png +0 -0
  48. files/third-party/colorpicker/img/custom_hex.png +0 -0
  49. files/third-party/colorpicker/img/custom_hsb_b.png +0 -0
  50. files/third-party/colorpicker/img/custom_hsb_h.png +0 -0
  51. files/third-party/colorpicker/img/custom_hsb_s.png +0 -0
  52. files/third-party/colorpicker/img/custom_indic.gif +0 -0
  53. files/third-party/colorpicker/img/custom_rgb_b.png +0 -0
  54. files/third-party/colorpicker/img/custom_rgb_g.png +0 -0
  55. files/third-party/colorpicker/img/custom_rgb_r.png +0 -0
  56. files/third-party/colorpicker/img/custom_submit.png +0 -0
  57. files/third-party/colorpicker/js/colorpicker.js +529 -0
  58. files/third-party/modal-box/modal-box-ie.css +8 -0
  59. files/third-party/modal-box/modal-box.css +73 -0
  60. files/third-party/tooltipster/css/tooltipster.css +274 -0
  61. files/third-party/tooltipster/js/html5.js +8 -0
  62. files/third-party/tooltipster/js/jquery.tooltipster.min.js +1 -0
  63. helper/wc-helper.php +174 -0
  64. includes/wc-db-helper.php +99 -0
  65. options-templates/options-template-main.php +273 -0
  66. options-templates/options-template-phrases.php +515 -0
  67. readme.txt +58 -0
  68. tasks.txt +0 -0
  69. wc-css.php +85 -0
  70. wc-options-serialize.php +294 -0
  71. wc-options.php +216 -0
  72. wc.php +449 -0
captcha/captcha.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* captcha.php file */
4
+ error_reporting(0);
5
+ $comm_id = isset($_GET['comm_id']) ? $_GET['comm_id'] : 0;
6
+ session_start();
7
+
8
+ header("Expires: Tue, 01 Jan 2014 00:00:00 GMT");
9
+ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
10
+ header("Cache-Control: no-store, no-cache, must-revalidate");
11
+ header("Cache-Control: post-check=0, pre-check=0", false);
12
+ header("Pragma: no-cache");
13
+
14
+ $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
15
+ $randomString = '';
16
+ $captcha_length = 5;
17
+
18
+ for ($i = 0; $i < $captcha_length; $i++) {
19
+ $randomString .= $chars[rand(0, strlen($chars) - 1)];
20
+ }
21
+
22
+ $_SESSION['wc_captcha'][$comm_id] = md5(strtolower(trim($randomString)));
23
+
24
+
25
+ $im = @imagecreatefrompng("captcha_bg_easy.png");
26
+
27
+
28
+ imagettftext($im, 16, 0, 5, 20, imagecolorallocate($im, 0, 0, 0), 'consolai.ttf', $randomString);
29
+
30
+ header('Content-type: image/png');
31
+ imagepng($im, NULL, 0);
32
+ imagedestroy($im);
33
+ ?>
captcha/captcha_bg_easy.png ADDED
Binary file
captcha/consolai.ttf ADDED
Binary file
comment-form/form.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php global $post, $wc_core;?>
2
+ <script type="text/javascript">
3
+ // initialize the validator function
4
+ validator.message['invalid'] = '<?php echo $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_invalid_field']; ?>';
5
+ validator.message['empty'] = '<?php echo $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_error_empty_text']; ?>';
6
+ validator.message['email'] = '<?php echo $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_error_email_text']; ?>';
7
+
8
+ jQuery(document).ready(function ($) {
9
+ $(document).delegate('.wc-toggle', 'click', function() {
10
+ var toggleID = $(this).attr('id');
11
+ var uniqueID = toggleID.substring(toggleID.lastIndexOf('-') + 1);
12
+ $('#wc-comm-' + uniqueID + ' .wc-reply').slideToggle(500, function () {
13
+ if ($(this).is(':hidden')) {
14
+ $('#' + toggleID).html('<?php echo $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_show_replies_text']; ?> &or;');
15
+ } else {
16
+ $('#' + toggleID).html('<?php echo $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_hide_replies_text']; ?> &and;');
17
+ }
18
+ });
19
+ });
20
+
21
+ if ($.cookie('wc_author_name') !== '' && $.cookie('wc_author_email')) {
22
+ $('#wpcomm .wc_name').val($.cookie('wc_author_name'));
23
+ $('#wpcomm .wc_email').val($.cookie('wc_author_email'));
24
+ }
25
+ });
26
+ </script>
27
+ <?php
28
+
29
+ $textarea_placeholder = '';
30
+ if ($post->comment_count) {
31
+ $textarea_placeholder = $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_comment_join_text'];
32
+ } else {
33
+ $textarea_placeholder = $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_comment_start_text'];
34
+ }
35
+ $unique_id = $post->ID . '_' . 0;
36
+ $header_text = '(' . $post->comment_count . ') ';
37
+ $header_text .= $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_header_text'];
38
+ $header_text .= ($post->comment_count > 1) ? $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_plural_text'] : '';
39
+ $header_text .= ' ' . $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_header_on_text'];
40
+ $header_text .= ' "' . get_the_title($post) . '"';
41
+ ?>
42
+
43
+ <div id="wpcomm">
44
+ <p class="wc-comment-title"><?php echo $header_text; ?></p>
45
+ <div class="wc-form-wrapper">
46
+ <?php
47
+ if ($wc_core->is_guest_can_comment()) {
48
+ ?>
49
+
50
+ <form action="" method="post" id="wc_comm_form-<?php echo $unique_id; ?>" class="wc_comm_form">
51
+ <div class="wc-field-comment">
52
+ <div style="width:60px; float:left; position:absolute;">
53
+ <?php echo $wc_core->wc_helper->get_comment_author_avatar(); ?>
54
+ </div>
55
+ <div style="margin-left:65px;" class="item"><textarea id="wc_comment-<?php echo $unique_id; ?>" class="wc_comment" name="wc_comment" required="required" placeholder="<?php echo $textarea_placeholder; ?>"></textarea></div>
56
+ <div style="clear:both"></div>
57
+ </div>
58
+ <div id="wc-form-footer-<?php echo $unique_id; ?>" class="wc-form-footer">
59
+ <?php if (!is_user_logged_in()) { ?>
60
+ <div class="wc-author-data">
61
+ <div class="wc-field-name item"><input id="wc_name-<?php echo $unique_id; ?>" class="wc_name" name="wc_name" required="required" value="" type="text" placeholder="<?php echo $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_name_text'] ?>"/></div>
62
+ <div class="wc-field-email item"><input id="wc_email-<?php echo $unique_id; ?>" class="wc_email email" name="wc_email" required="required" value="" type="email" placeholder="<?php echo $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_email_text']; ?>"/></div>
63
+ <div style="clear:both"></div>
64
+ </div>
65
+ <?php } ?>
66
+ <div class="wc-form-submit">
67
+ <?php if (!$wc_core->wc_options->wc_options_serialize->wc_captcha_show_hide) { ?>
68
+ <?php if (!is_user_logged_in()) { ?>
69
+ <div class="wc-field-captcha item">
70
+ <input id="wc_captcha-<?php echo $unique_id; ?>" name="wc_captcha" required="required" value="" type="text" />
71
+ <span class="wc-label wc-captcha-label">
72
+ <img src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/captcha/captcha.php?comm_id=' . $post->ID . '-' . 0); ?>" id="wc_captcha_img-<?php echo $unique_id; ?>" />
73
+ <img src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/refresh-16x16.png'); ?>" id="wc_captcha_refresh_img-<?php echo $unique_id; ?>" class="wc_captcha_refresh_img" />
74
+ </span>
75
+ <span class="captcha_msg"><?php echo $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_captcha_text']; ?></span>
76
+ </div>
77
+ <?php } ?>
78
+ <?php } ?>
79
+ <div class="wc-field-submit"><input type="button" name="submit" value="<?php echo $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_submit_text']; ?>" id="wc_comm-<?php echo $unique_id; ?>" class="wc_comm_submit button alt"/></div>
80
+ <div style="clear:both"></div>
81
+ </div>
82
+ </div>
83
+ <input type="hidden" name="wc_home_url" value="<?php echo plugins_url(); ?>" id="wc_home_url" />
84
+ <input type="hidden" name="wc_plugin_dir_url" value="<?php echo WC_Core::$PLUGIN_DIRECTORY; ?>" id="wc_plugin_dir_url" />
85
+ <input type="hidden" name="wc_comment_post_ID" value="<?php echo $post->ID; ?>" id="wc_comment_post_ID-<?php echo $unique_id; ?>" />
86
+ <input type="hidden" name="wc_comment_parent" value="0" id="wc_comment_parent-<?php echo $unique_id; ?>" />
87
+ </form>
88
+ <?php } else { ?>
89
+ <p class="wc-must-login"><?php echo $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_you_must_be_text']; ?> <a href="<?php echo wp_login_url(); ?>"><?php echo $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_logged_in_text']; ?></a> <?php echo $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_to_post_comment_text']; ?></p>
90
+ <?php } ?>
91
+ </div>
92
+ <hr/>
93
+
94
+ <div class="wc-thread-wrapper">
95
+ <?php $wc_parent_comments_count = $wc_core->get_wp_comments(1); ?>
96
+ </div>
97
+
98
+ <?php if ($wc_parent_comments_count > $wc_core->wc_options->wc_options_serialize->wc_comment_count) { ?>
99
+ <div class="wc-load-more-submit-wrap">
100
+ <input type="button" name="submit" value="<?php echo $wc_core->wc_options->wc_options_serialize->wc_phrases['wc_load_more_submit_text']; ?>" id="wc-load-more-submit-<?php echo $unique_id; ?>" class="wc-load-more-submit button"/>
101
+ <input type="hidden" name="wc_comments_offset" id="wc_comments_offset" value="1" />
102
+ <input type="hidden" name="wc_parent_per_page" id="wc_parent_per_page" value="<?php echo $wc_core->wc_options->wc_options_serialize->wc_comment_count; ?>" />
103
+ <input type="hidden" name="wc_parent_comments_count" id="wc_parent_comments_count" value="<?php echo $wc_parent_comments_count; ?>" />
104
+ </div>
105
+ <?php } ?>
106
+
107
+ <div id="wc_openModalFormAction" class="modalDialog">
108
+ <div id="wc_response_info" class="wc_modal">
109
+ <div id="wc_response_info_box">
110
+ <a href="#close" title="Close" class="close">&nbsp;</a>
111
+ <img width="64" height="64" src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/loader/ajax-loader-200x200.gif'); ?>" />
112
+ </div>
113
+ </div>
114
+ </div>
115
+ </div>
comment-form/tpl-comment.php ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WC_Comment_Template_Builder {
4
+
5
+ public $wc_helper;
6
+ public $wc_db_helper;
7
+ public $wc_options;
8
+
9
+ function __construct($wc_helper, $wc_db_helper, $wc_options) {
10
+ $this->wc_helper = $wc_helper;
11
+ $this->wc_db_helper = $wc_db_helper;
12
+ $this->wc_options = $wc_options;
13
+ }
14
+
15
+ /**
16
+ * @param type $comment the current comment object
17
+ * @param type $args
18
+ * @return single comment template
19
+ */
20
+ public function get_comment_template($comment) {
21
+ $comment_content = $comment->comment_content;
22
+
23
+ $vote_cls = '';
24
+ $vote_title_text = '';
25
+ $user = get_user_by('id', $comment->user_id);
26
+ if ($user) {
27
+ $post = get_post($comment->comment_post_ID);
28
+ if ($user->ID == $post->post_author) {
29
+ $author_title = $this->wc_options->wc_options_serialize->wc_phrases['wc_user_title_author_text'];
30
+ } else if (in_array('administrator', $user->roles)) {
31
+ $author_title = $this->wc_options->wc_options_serialize->wc_phrases['wc_user_title_admin_text'];
32
+ } else {
33
+ $author_title = $this->wc_options->wc_options_serialize->wc_phrases['wc_user_title_member_text'];
34
+ }
35
+ } else {
36
+ $author_title = $this->wc_options->wc_options_serialize->wc_phrases['wc_user_title_guest_text'];
37
+ }
38
+
39
+ $posted_date = $this->wc_helper->dateDiff(time(), strtotime($comment->comment_date_gmt), 2);
40
+
41
+ $reply_text = $this->wc_options->wc_options_serialize->wc_phrases['wc_reply_text'];
42
+ $share_text = $this->wc_options->wc_options_serialize->wc_phrases['wc_share_text'];
43
+ $comment_wrapper_class = ($comment->comment_parent) ? 'wc-comment wc-reply' : 'wc-comment';
44
+ $textarea_placeholder = $this->get_textarea_placeholder($comment);
45
+ $comm_author_avatar = $this->wc_helper->get_comment_author_avatar($comment);
46
+ $vote_count = ($comment->votes) ? $comment->votes : 0;
47
+ $unique_id = $this->get_unique_id($comment);
48
+
49
+ $child_comments = get_comments(array(
50
+ 'parent' => $comment->comment_ID,
51
+ 'status' => 'approve'
52
+ ));
53
+
54
+ if (!is_user_logged_in()) {
55
+ $vote_cls = ' wc_tooltipster';
56
+ $vote_title_text = $this->wc_options->wc_options_serialize->wc_phrases['wc_login_to_vote'];
57
+ $vote_up = $vote_title_text;
58
+ $vote_down = $vote_title_text;
59
+ } else {
60
+ $vote_cls = ' wc_vote';
61
+ $vote_up = $this->wc_options->wc_options_serialize->wc_phrases['wc_vote_up'];
62
+ $vote_down = $this->wc_options->wc_options_serialize->wc_phrases['wc_vote_down'];
63
+ }
64
+
65
+ $parent_comment = (!$comment->comment_parent && count($child_comments)) ? ' parnet_comment' : '';
66
+
67
+ $output = '<div id="wc-comm-' . $unique_id . '" class="' . $comment_wrapper_class . ' ' . $parent_comment . '">';
68
+ $output .= '<div class="wc-comment-left">' . $comm_author_avatar;
69
+ if (!$this->wc_options->wc_options_serialize->wc_author_titles_show_hide) {
70
+ $output .= '<div class="wc-comment-label">' . $author_title . '</div>';
71
+ }
72
+ $output .= '</div>';
73
+ $output .= '<div class="wc-comment-right">';
74
+ $output .= '<div class="wc-comment-header"><div class="wc-comment-author">' . $comment->comment_author . '</div><div class="wc-comment-date">' . $posted_date . '</div><div style="clear:both"></div></div>';
75
+ $output .= '<div class="wc-comment-text">' . $comment_content . '</div>';
76
+ $output .= '<div class="wc-comment-footer">';
77
+ if (!$this->wc_options->wc_options_serialize->wc_voting_buttons_show_hide) {
78
+ $output .= '<div id="vote-count-' . $unique_id . '" class="wc-vote-result">' . $vote_count . '</div>';
79
+ $output .= '<span id="wc-up-' . $unique_id . '" class="wc-vote-link wc-up ' . $vote_cls . '" title="' . $vote_up . '">&and;</span> | <span id="wc-down-' . $unique_id . '" class="wc-vote-link wc-down ' . $vote_cls . '" title="' . $vote_down . '">&or;</span> &nbsp;&nbsp;';
80
+ }
81
+
82
+ if ($this->is_guest_can_reply() && $this->is_customer_can_reply()) {
83
+ $output .= '&nbsp;&nbsp;<span id="wc-comm-reply-' . $unique_id . '" class="wc-reply-link" title="' . $reply_text . '">' . $reply_text . '</span> &nbsp;&nbsp;';
84
+ }
85
+
86
+
87
+ if (!$this->wc_options->wc_options_serialize->wc_share_buttons_show_hide) {
88
+ $output .= '-&nbsp;&nbsp; <span id="wc-comm-share-' . $unique_id . '" class="wc-share-link" title="' . $share_text . '">' . $share_text . '</span> &nbsp;&nbsp;';
89
+
90
+ $twitt_content = $comment_content . ' ' . get_comment_link($comment);
91
+
92
+ $output .= '<span id="share_buttons_box-' . $unique_id . '" class="share_buttons_box">';
93
+ $output .= '<a target="_blank" href="http://www.facebook.com/sharer.php" title="' . $this->wc_options->wc_options_serialize->wc_phrases['wc_share_facebook'] . '"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/fb-18x18.png') . '"/></a>&nbsp;&nbsp;';
94
+ $output .= '<a target="_blank" href="https://twitter.com/home?status=' . $twitt_content . '" title="' . $this->wc_options->wc_options_serialize->wc_phrases['wc_share_twitter'] . '"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/twitter-18x18.png') . '"/></a>&nbsp;&nbsp;';
95
+ $output .= '<a target="_blank" href="https://plus.google.com/share?url=' . get_permalink($comment->comment_post_ID) . '" title="' . $this->wc_options->wc_options_serialize->wc_phrases['wc_share_google'] . '"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/social-icons/google-18x18.png') . '"/></a>&nbsp;&nbsp;';
96
+ $output .= '</span>';
97
+ }
98
+
99
+ if (current_user_can('edit_comment', $comment->comment_ID)) {
100
+ $output .= '-&nbsp;&nbsp; <a href="' . get_edit_comment_link($comment->comment_ID) . '">' . __('Edit', 'wpdiscuz') . '</a>';
101
+ }
102
+
103
+
104
+
105
+ $visibility = 'none';
106
+ if (!$comment->comment_parent && count($child_comments)) {
107
+ $visibility = 'block';
108
+ $output .= '<span id="wc-toggle-' . $unique_id . '" class="wc-toggle" style="display:' . $visibility . ';">' . $this->wc_options->wc_options_serialize->wc_phrases['wc_hide_replies_text'] . ' &and;</span>';
109
+ }
110
+
111
+ $output .= '</div>';
112
+ $output .= '</div>';
113
+ $output .= '<div style="clear:both"></div>';
114
+
115
+ if ($this->is_guest_can_reply() && $this->is_customer_can_reply()) {
116
+ $output .= '<div class="wc-form-wrapper wc-secondary-forms-wrapper" id="wc-secondary-forms-wrapper-' . $unique_id . '">';
117
+ $output .= '<form action="" method="post" id="wc_comm_form-' . $unique_id . '" class="wc_comm_form">';
118
+ $output .= '<div class="wc-field-comment"><div style="width:60px; float:left; position:absolute;">' . $this->wc_helper->get_comment_author_avatar() . '</div><div style="margin-left:65px;" class="item"><textarea id="wc_comment-' . $unique_id . '" class="wc_comment" name="wc_comment" required="required" placeholder="' . $textarea_placeholder . '"></textarea></div><div style="clear:both"></div></div>';
119
+
120
+ $output .= '<div id="wc-form-footer-' . $unique_id . '" class="wc-form-footer">';
121
+
122
+ if (!is_user_logged_in()) {
123
+ $output .= '<div class="wc-author-data"><div class="wc-field-name item"><input id="wc_name-' . $unique_id . '" name="wc_name" class="wc_name" required="required" value="" type="text" placeholder="' . $this->wc_options->wc_options_serialize->wc_phrases['wc_name_text'] . '"/></div><div class="wc-field-email item"><input id="wc_email-' . $unique_id . '" class="wc_email email" name="wc_email" required="required" value="" type="email" placeholder="' . $this->wc_options->wc_options_serialize->wc_phrases['wc_email_text'] . '"/></div><div style="clear:both"></div></div>';
124
+ }
125
+
126
+ $output .= '<div class="wc-form-submit">';
127
+
128
+ if (!$this->wc_options->wc_options_serialize->wc_captcha_show_hide) {
129
+ if (!is_user_logged_in()) {
130
+ $output .= '<div class="wc-field-captcha item"><input id="wc_captcha-' . $unique_id . '" name="wc_captcha" required="required" value="" type="text" /><span class="wc-label wc-captcha-label"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/captcha/captcha.php?comm_id=' . $comment->comment_post_ID . '-' . $comment->comment_ID) . '" id="wc_captcha_img-' . $unique_id . '" /><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/refresh-16x16.png') . '" id="wc_captcha_refresh_img-' . $unique_id . '" class="wc_captcha_refresh_img" /></span><span class="captcha_msg">' . $this->wc_options->wc_options_serialize->wc_phrases['wc_captcha_text'] . '</span></div>';
131
+ }
132
+ }
133
+
134
+ $output .= '<div class="wc-field-submit"><input type="button" name="submit" value="' . $this->wc_options->wc_options_serialize->wc_phrases['wc_submit_text'] . '" id="wc_comm-' . $unique_id . '" class="wc_comm_submit button alt"/>
135
+ <div class="wc-copyright"><a href="http://www.gvectors.com/" target="_blank">by gVectors Team</a></div>
136
+ </div>';
137
+ $output .= '<div style="clear:both"></div>';
138
+ $output .= '</div>';
139
+ $output .= '</div>';
140
+
141
+ $output .= '<input type="hidden" name="wc_home_url" value="' . plugins_url() . '" id="wc_home_url-' . $unique_id . '" />';
142
+ $output .= '<input type="hidden" name="wc_comment_post_ID" value="' . $comment->comment_post_ID . '" id="wc_comment_post_ID-' . $unique_id . '" />';
143
+ $output .= '<input type="hidden" name="wc_comment_parent" value="' . $comment->comment_ID . '" id="wc_comment_parent-' . $unique_id . '" />';
144
+
145
+ $output .= '</form>';
146
+ $output .= '</div>';
147
+ }
148
+ return $output;
149
+ }
150
+
151
+ public function is_guest_can_reply() {
152
+ $user_can_comment = TRUE;
153
+ if (!$this->wc_options->wc_options_serialize->wc_user_must_be_registered) {
154
+ if ($this->wc_options->wc_options_serialize->wc_reply_button_guests_show_hide) {
155
+ if (!is_user_logged_in()) {
156
+ $user_can_comment = FALSE;
157
+ }
158
+ }
159
+ } else {
160
+ if (!is_user_logged_in()) {
161
+ $user_can_comment = FALSE;
162
+ }
163
+ }
164
+ return $user_can_comment;
165
+ }
166
+
167
+ public function is_customer_can_reply() {
168
+ $user_can_comment = TRUE;
169
+ if ($this->wc_options->wc_options_serialize->wc_reply_button_members_show_hide) {
170
+ $user_can_comment = $this->is_user_can_reply_by_role('customer');
171
+ }
172
+ return $user_can_comment;
173
+ }
174
+
175
+ /**
176
+ * User can comment in product by role
177
+ */
178
+ private function is_user_can_reply_by_role($role) {
179
+ $user_can_comment = FALSE;
180
+ if (is_user_logged_in()) {
181
+ $current_user = wp_get_current_user();
182
+ $roles = $current_user->roles;
183
+ if (!in_array($role, $roles)) {
184
+ $user_can_comment = TRUE;
185
+ }
186
+ }
187
+ return $user_can_comment;
188
+ }
189
+
190
+ /**
191
+ * returns placeholder for textarea from options page phrases
192
+ */
193
+ public function get_textarea_placeholder($comment) {
194
+ $post = get_post($comment->comment_post_ID);
195
+ if ($post->comment_count) {
196
+ $textarea_placeholder = $this->wc_options->wc_options_serialize->wc_phrases['wc_comment_join_text'];
197
+ } else {
198
+ $textarea_placeholder = $this->wc_options->wc_options_serialize->wc_phrases['wc_comment_start_text'];
199
+ }
200
+ return $textarea_placeholder;
201
+ }
202
+
203
+ /**
204
+ * returns unique id based on comment and post ids
205
+ */
206
+ public function get_unique_id($comment) {
207
+ $unique_id = $comment->comment_post_ID . '_' . $comment->comment_ID;
208
+ return $unique_id;
209
+ }
210
+
211
+ /**
212
+ * set wpc helper
213
+ */
214
+ public function set_wc_helper($wc_helper) {
215
+ $this->wc_helper = $wc_helper;
216
+ }
217
+
218
+ /**
219
+ * set db helper
220
+ */
221
+ public function set_wc_db_helper($wc_db_helper) {
222
+ $this->wc_db_helper = $wc_db_helper;
223
+ }
224
+
225
+ /**
226
+ * set wpc options
227
+ */
228
+ public function set_wc_options($wc_options) {
229
+ $this->wc_options = $wc_options;
230
+ }
231
+
232
+ }
233
+
234
+ ?>
dto/wc-comment.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WC_Comment {
4
+
5
+ public $comment_ID;
6
+ public $comment_post_ID;
7
+ public $comment_author;
8
+ public $comment_author_email;
9
+ public $comment_author_url;
10
+ public $comment_author_IP;
11
+ public $comment_date;
12
+ public $comment_date_gmt;
13
+ public $comment_content;
14
+ public $comment_karma;
15
+ public $comment_approved;
16
+ public $comment_agent;
17
+ public $comment_type;
18
+ public $comment_parent;
19
+ public $user_id;
20
+ public $votes;
21
+
22
+ public function __construct($comment) {
23
+ $this->comment_ID = $comment->comment_ID;
24
+ $this->comment_post_ID = $comment->comment_post_ID;
25
+ $this->comment_author = $comment->comment_author;
26
+ $this->comment_author_email = $comment->comment_author_email;
27
+ $this->comment_author_url = $comment->comment_author_url;
28
+ $this->comment_author_IP = $comment->comment_author_IP;
29
+ $this->comment_date = $comment->comment_date;
30
+ $this->comment_date_gmt = $comment->comment_date_gmt;
31
+ $this->comment_content = $comment->comment_content;
32
+ $this->comment_karma = $comment->comment_karma;
33
+ $this->comment_approved = $comment->comment_approved;
34
+ $this->comment_agent = $comment->comment_agent;
35
+ $this->comment_type = $comment->comment_type;
36
+ $this->comment_parent = $comment->comment_parent;
37
+ $this->user_id = $comment->user_id;
38
+ $this->votes = $this->get_vote_count($comment->comment_ID);
39
+ }
40
+
41
+ public function get_vote_count($comment_id) {
42
+ return get_comment_meta($comment_id, 'wpdiscuz_votes', true);
43
+ }
44
+
45
+ public function get_votes() {
46
+ return $this->votes;
47
+ }
48
+
49
+ public function set_votes($votes) {
50
+ $this->votes = $votes;
51
+ }
52
+
53
+ }
54
+
55
+ ?>
files/css/fv.css ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*input, textarea{ border:1px solid #D1D1D1; }
2
+ input, select{ font-size:inherit; margin:0; }
3
+ input:focus, textarea:focus{ border-color:#AAA; }
4
+
5
+ input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
6
+ input[type=checkbox]{ width:auto; border:none; bottom:-1px; cursor:pointer; margin:0 5px 0 0; position:relative; }
7
+ button[type=submit]{ font-size:1.1em; padding:5px 25px; }*/
8
+
9
+ /* Tooltips helpers */
10
+ .item .tooltip{ float:left; top:2px; left:7px; position:relative; z-index:2; }
11
+ .item .tooltip:hover{ z-index:3; }
12
+ .item .tooltip > span{ display:inline-block; width:15px; height:15px; line-height:15px; font-size:0.9em; font-weight:bold; text-align:center; color:#FFF; cursor:help; background-color:#00AEEF; position:relative; border-radius:10px; }
13
+ .item .tooltip .content{ opacity:0; width:200px; background-color:#333; color:#FFF; font-size:0.9em; position:absolute; top:0; left:20px; padding:8px; border-radius:6px; pointer-events:none; transition:0.2s cubic-bezier(0.1, 0.1, 0.25, 2); -webkit-transition:0.3s cubic-bezier(0.1, 0.2, 0.5, 2.2); -moz-transition:0.3s cubic-bezier(0.1, 0.2, 0.5, 2.2); }
14
+ .item .tooltip p{ padding:0; }
15
+ .item .tooltip.down .content{ left:auto; right:0; top:30px; }
16
+ .item .tooltip:hover .content{ opacity:1; left:36px; }
17
+ .item .tooltip .content b{ height:0; width:0; border-color:#333 #333 transparent transparent; border-style:solid; border-width:9px 7px; position:absolute; left:-14px; top:8px; }
18
+ .item .tooltip.down .content b{ left:auto; right:6px; top:-10px; border-width:5px; border-color:transparent #333 #333 transparent; }
19
+
20
+ /* alerts (when validation fails) */
21
+ .item .alert{ float:left; margin:0px; padding:2px 10px; color:#DD0000; border-radius:3px 4px 4px 3px; background-color:#FFE8E8; white-space:pre; position:relative; left:-15px; opacity:0; z-index:1; transition:0.15s ease-out; }
22
+ .item .alert {max-width: 100%;position: absolute;top: -50%;font-size: 12px;}
23
+ /*.item .alert::after{ content:''; display:block; height:0; width:0; border-color:transparent #CE5454 transparent transparent; border-style:solid; border-width:11px 7px; position:absolute; left:-13px; top:1px; }*/
24
+ .item.bad .alert{ left:0; opacity:1; }
25
+
26
+
27
+ @keyframes shake{
28
+ 15%{ transform:translateX(-5px); }
29
+ 30%{ transform:translateX(5px); }
30
+ 45%{ transform:translateX(-3px); }
31
+ 60%{ transform:translateX(3px); }
32
+ 75%{ transform:translateX(2px); }
33
+ 100%{ transform:none; }
34
+ }
35
+ @-webkit-keyframes shake{
36
+ 25%{ -webkit-transform:translateX(-6px); }
37
+ 75%{ -webkit-transform:translateX(6px); }
38
+ }
39
+
40
+ form fieldset{ clear:both; margin:0 0 10px 0; }
41
+ form .item{ padding:5px 0; position:relative; height:2em; font-family: Lato,sans-serif; }
42
+ form .item.items{ height:auto; }
43
+ .item label, .item .label{ float:left; cursor:pointer; }
44
+ .item label span, .item .label{ float:left; width:160px; text-transform:capitalize; line-height:2em; }
45
+ .item input, .item textarea{ float:left; padding:3px 4px; width:210px; -webkit-transition:0.2s; -moz-transition:0.2s; transition:0.2s; }
46
+ .item input[type=checkbox]{ width:auto; }
47
+
48
+ .label ~ label{ vertical-align:middle; margin:0.3em 1.2em 0 0; }
49
+
50
+ .item input.short{ width:90px; }
51
+ .item input:focus:not([type="checkbox"]), .item textarea:focus{ box-shadow:0 0 4px #BCBCBC; border:1px solid #BCBCBC; }
52
+
53
+ .item textarea{ }
54
+ .item select{ float:left; width:220px; padding:2px 0; margin:0; border:1px solid #CCC; text-transform:capitalize; }
55
+ .item select option{ padding:1px; }
56
+
57
+ .item > .extra{ float:left; font-size:0.9em; color:#999; line-height:2em; margin-left:13px; }
58
+
59
+ .item.multi .input{ float:left; }
60
+ .item.multi input{ float:left; margin-right:5px; width:35px; text-align:center; }
61
+ form .item.multi input:nth-last-child(-n+2){ margin:0; }
62
+ .item.items input{ border-top:5px solid #E1E1E1; margin:0 0 0 160px; }
63
+
64
+ .bad input,
65
+ .bad select,
66
+ .bad textarea{ box-shadow:0 0 4px -2px #CE5454; position:relative; left:0; /*-moz-animation:.7s 1 shake linear; -webkit-animation:0.7s 1 shake linear;*/ }
67
+
68
+ .wc_comm_form input {box-shadow: 0 0 4px -2px #d4d0ba;}
69
+ .wc_comm_form textarea{box-shadow:0 0 4px -2px #d4d0ba;}
files/css/options-css.css ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /* ===== Options Form CSS ===== */
2
+
3
+ .wc-form tr:nth-child(even) {background: #fff}
4
+ .wc-form tr:nth-child(odd) {background: #fbfbfb}
5
+
6
+ .wpdiscuz_options_page .wc-phrases-settings-form input[type="text"],
7
+ .wpdiscuz_options_page .wc-phrases-settings-form textarea {
8
+ width: 300px;
9
+ }
10
+
files/img/avatar_default.png ADDED
Binary file
files/img/loader/ajax-loader-200x200.gif ADDED
Binary file
files/img/loader/warning.png ADDED
Binary file
files/img/plugin-icon/plugin-icon-20.png ADDED
Binary file
files/img/plugin-icon/plugin-icon-48.png ADDED
Binary file
files/img/refresh-16x16.png ADDED
Binary file
files/img/refresh-32x32.png ADDED
Binary file
files/img/social-icons/fb-18x18.png ADDED
Binary file
files/img/social-icons/fb-24x24.png ADDED
Binary file
files/img/social-icons/google-18x18.png ADDED
Binary file
files/img/social-icons/google-24x24.png ADDED
Binary file
files/img/social-icons/twitter-18x18.png ADDED
Binary file
files/img/social-icons/twitter-24x24.png ADDED
Binary file
files/img/x.png ADDED
Binary file
files/js/jquery.autogrowtextarea.min.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * ----------------------------------------------------------------------------
3
+ * "THE BEER-WARE LICENSE" (Revision 42):
4
+ * <jevin9@gmail.com> wrote this file. As long as you retain this notice you
5
+ * can do whatever you want with this stuff. If we meet some day, and you think
6
+ * this stuff is worth it, you can buy me a beer in return. Jevin O. Sewaruth
7
+ * ----------------------------------------------------------------------------
8
+ *
9
+ * Autogrow Textarea Plugin Version v3.0
10
+ * http://www.technoreply.com/autogrow-textarea-plugin-3-0
11
+ *
12
+ * THIS PLUGIN IS DELIVERD ON A PAY WHAT YOU WHANT BASIS. IF THE PLUGIN WAS USEFUL TO YOU, PLEASE CONSIDER BUYING THE PLUGIN HERE :
13
+ * https://sites.fastspring.com/technoreply/instant/autogrowtextareaplugin
14
+ *
15
+ * Date: October 15, 2012
16
+ */
17
+
18
+ jQuery.fn.autoGrow=function(){return this.each(function(){var createMirror=function(textarea){jQuery(textarea).after('<div class="autogrow-textarea-mirror"></div>');return jQuery(textarea).next(".autogrow-textarea-mirror")[0]};var sendContentToMirror=function(textarea){mirror.innerHTML=String(textarea.value).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />")+".<br/>.";if(jQuery(textarea).height()!=jQuery(mirror).height())jQuery(textarea).height(jQuery(mirror).height())};
19
+ var growTextarea=function(){sendContentToMirror(this)};var mirror=createMirror(this);mirror.style.display="none";mirror.style.wordWrap="break-word";mirror.style.padding=jQuery(this).css("padding");mirror.style.width=jQuery(this).css("width");mirror.style.fontFamily=jQuery(this).css("font-family");mirror.style.fontSize=jQuery(this).css("font-size");mirror.style.lineHeight=jQuery(this).css("line-height");this.style.overflow="hidden";this.style.minHeight=this.rows+"em";this.onkeydown=growTextarea;sendContentToMirror(this)})};
files/js/jquery.cookie.js ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Cookie Plugin v1.4.1
3
+ * https://github.com/carhartl/jquery-cookie
4
+ *
5
+ * Copyright 2013 Klaus Hartl
6
+ * Released under the MIT license
7
+ */
8
+ (function (factory) {
9
+ if (typeof define === 'function' && define.amd) {
10
+ // AMD
11
+ define(['jquery'], factory);
12
+ } else if (typeof exports === 'object') {
13
+ // CommonJS
14
+ factory(require('jquery'));
15
+ } else {
16
+ // Browser globals
17
+ factory(jQuery);
18
+ }
19
+ }(function ($) {
20
+
21
+ var pluses = /\+/g;
22
+
23
+ function encode(s) {
24
+ return config.raw ? s : encodeURIComponent(s);
25
+ }
26
+
27
+ function decode(s) {
28
+ return config.raw ? s : decodeURIComponent(s);
29
+ }
30
+
31
+ function stringifyCookieValue(value) {
32
+ return encode(config.json ? JSON.stringify(value) : String(value));
33
+ }
34
+
35
+ function parseCookieValue(s) {
36
+ if (s.indexOf('"') === 0) {
37
+ // This is a quoted cookie as according to RFC2068, unescape...
38
+ s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
39
+ }
40
+
41
+ try {
42
+ // Replace server-side written pluses with spaces.
43
+ // If we can't decode the cookie, ignore it, it's unusable.
44
+ // If we can't parse the cookie, ignore it, it's unusable.
45
+ s = decodeURIComponent(s.replace(pluses, ' '));
46
+ return config.json ? JSON.parse(s) : s;
47
+ } catch(e) {}
48
+ }
49
+
50
+ function read(s, converter) {
51
+ var value = config.raw ? s : parseCookieValue(s);
52
+ return $.isFunction(converter) ? converter(value) : value;
53
+ }
54
+
55
+ var config = $.cookie = function (key, value, options) {
56
+
57
+ // Write
58
+
59
+ if (value !== undefined && !$.isFunction(value)) {
60
+ options = $.extend({}, config.defaults, options);
61
+
62
+ if (typeof options.expires === 'number') {
63
+ var days = options.expires, t = options.expires = new Date();
64
+ t.setTime(+t + days * 864e+5);
65
+ }
66
+
67
+ return (document.cookie = [
68
+ encode(key), '=', stringifyCookieValue(value),
69
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
70
+ options.path ? '; path=' + options.path : '',
71
+ options.domain ? '; domain=' + options.domain : '',
72
+ options.secure ? '; secure' : ''
73
+ ].join(''));
74
+ }
75
+
76
+ // Read
77
+
78
+ var result = key ? undefined : {};
79
+
80
+ // To prevent the for loop in the first place assign an empty array
81
+ // in case there are no cookies at all. Also prevents odd result when
82
+ // calling $.cookie().
83
+ var cookies = document.cookie ? document.cookie.split('; ') : [];
84
+
85
+ for (var i = 0, l = cookies.length; i < l; i++) {
86
+ var parts = cookies[i].split('=');
87
+ var name = decode(parts.shift());
88
+ var cookie = parts.join('=');
89
+
90
+ if (key && key === name) {
91
+ // If second argument (value) is a function it's a converter...
92
+ result = read(cookie, value);
93
+ break;
94
+ }
95
+
96
+ // Prevent storing a cookie that we couldn't decode.
97
+ if (!key && (cookie = read(cookie)) !== undefined) {
98
+ result[name] = cookie;
99
+ }
100
+ }
101
+
102
+ return result;
103
+ };
104
+
105
+ config.defaults = {};
106
+
107
+ $.removeCookie = function (key, options) {
108
+ if ($.cookie(key) === undefined) {
109
+ return false;
110
+ }
111
+
112
+ // Must not alter options, thus extending a fresh object...
113
+ $.cookie(key, '', $.extend({}, options, { expires: -1 }));
114
+ return !$.cookie(key);
115
+ };
116
+
117
+ }));
files/js/options-js.js ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function ($) {
2
+ $('#wc_voting_buttons_show_hide').change(function () {
3
+ if ($(this).is(':checked')) {
4
+ $(this).val('1');
5
+ } else {
6
+ $(this).val('0');
7
+ }
8
+ });
9
+
10
+ $('#wc_share_buttons_show_hide').change(function () {
11
+ if ($(this).is(':checked')) {
12
+ $(this).val('1');
13
+ } else {
14
+ $(this).val('0');
15
+ }
16
+ });
17
+
18
+ $('#wc_captcha_show_hide').change(function () {
19
+ if ($(this).is(':checked')) {
20
+ $(this).val('1');
21
+ } else {
22
+ $(this).val('0');
23
+ }
24
+ });
25
+
26
+ $('#wc_reply_button_guests_show_hide').change(function () {
27
+ if ($(this).is(':checked')) {
28
+ $(this).val('1');
29
+ } else {
30
+ $(this).val('0');
31
+ }
32
+ });
33
+
34
+ $('#wc_reply_button_members_show_hide').change(function () {
35
+ if ($(this).is(':checked')) {
36
+ $(this).val('1');
37
+ } else {
38
+ $(this).val('0');
39
+ }
40
+ });
41
+
42
+ $('#wc_author_titles_show_hide').change(function () {
43
+ if ($(this).is(':checked')) {
44
+ $(this).val('1');
45
+ } else {
46
+ $(this).val('0');
47
+ }
48
+ });
49
+
50
+ $('#wc_jquery_ajax_features_on_off').change(function () {
51
+ if ($(this).is(':checked')) {
52
+ $(this).val('1');
53
+ } else {
54
+ $(this).val('0');
55
+ }
56
+ });
57
+
58
+ $('#wc_held_comment_to_moderate').change(function () {
59
+ if ($(this).is(':checked')) {
60
+ $(this).val('1');
61
+ } else {
62
+ $(this).val('0');
63
+ }
64
+ });
65
+
66
+ $('#wc_notify_moderator').change(function () {
67
+ if ($(this).is(':checked')) {
68
+ $(this).val('1');
69
+ } else {
70
+ $(this).val('0');
71
+ }
72
+ });
73
+
74
+ $('#wc_notify_comment_author').change(function () {
75
+ if ($(this).is(':checked')) {
76
+ $(this).val('1');
77
+ } else {
78
+ $(this).val('0');
79
+ }
80
+ });
81
+ });
files/js/validator.js ADDED
@@ -0,0 +1,392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Validator v1.1.0
3
+ (c) Yair Even Or
4
+ https://github.com/yairEO/validator
5
+
6
+ MIT-style license.
7
+ */
8
+
9
+ var validator = (function($) {
10
+ var message, tests, checkField, validate, mark, unmark, field, minmax, defaults,
11
+ validateWords, lengthRange, lengthLimit, pattern, alertTxt, data,
12
+ email_illegalChars = /[\(\)\<\>\,\;\:\\\/\"\[\]]/,
13
+ email_filter = /^.+@.+\..{2,3}$/;
14
+
15
+ /* general text messages
16
+ */
17
+ message = {
18
+ invalid: 'invalid input',
19
+ empty: 'please put something here',
20
+ min: 'input is too short',
21
+ max: 'input is too long',
22
+ number_min: 'too low',
23
+ number_max: 'too high',
24
+ url: 'invalid URL',
25
+ number: 'not a number',
26
+ email: 'email address is invalid',
27
+ email_repeat: 'emails do not match',
28
+ password_repeat: 'passwords do not match',
29
+ repeat: 'no match',
30
+ complete: 'input is not complete',
31
+ select: 'Please select an option'
32
+ };
33
+
34
+ if (!window.console) {
35
+ console = {};
36
+ console.log = console.warn = function() {
37
+ return;
38
+ }
39
+ }
40
+
41
+ // defaults
42
+ defaults = {alerts: true};
43
+
44
+ /* Tests for each type of field (including Select element)
45
+ */
46
+ tests = {
47
+ sameAsPlaceholder: function(a) {
48
+ return $.fn.placeholder && a.attr('placeholder') !== undefined && data.val == a.prop('placeholder');
49
+ },
50
+ hasValue: function(a) {
51
+ if (!a) {
52
+ alertTxt = message.empty;
53
+ return false;
54
+ }
55
+ return true;
56
+ },
57
+ // 'linked' is a special test case for inputs which their values should be equal to each other (ex. confirm email or retype password)
58
+ linked: function(a, b) {
59
+ if (b != a) {
60
+ // choose a specific message or a general one
61
+ alertTxt = message[data.type + '_repeat'] || message.no_match;
62
+ return false;
63
+ }
64
+ return true;
65
+ },
66
+ email: function(a) {
67
+ if (!email_filter.test(a) || a.match(email_illegalChars)) {
68
+ alertTxt = a ? message.email : message.empty;
69
+ return false;
70
+ }
71
+ return true;
72
+ },
73
+ text: function(a) {
74
+ // make sure there are at least X number of words, each at least 2 chars long.
75
+ // for example 'john F kenedy' should be at least 2 words and will pass validation
76
+ if (validateWords) {
77
+ var words = a.split(' ');
78
+ // iterrate on all the words
79
+ var wordsLength = function(len) {
80
+ for (var w = words.length; w--; )
81
+ if (words[w].length < len)
82
+ return false;
83
+ return true;
84
+ };
85
+
86
+ if (words.length < validateWords || !wordsLength(2)) {
87
+ alertTxt = message.complete;
88
+ return false;
89
+ }
90
+ return true;
91
+ }
92
+ if (lengthRange && a.length < lengthRange[0]) {
93
+ alertTxt = message.min;
94
+ return false;
95
+ }
96
+
97
+ // check if there is max length & field length is greater than the allowed
98
+ if (lengthRange && lengthRange[1] && a.length > lengthRange[1]) {
99
+ alertTxt = message.max;
100
+ return false;
101
+ }
102
+ // check if the field's value should obey any length limits, and if so, make sure the length of the value is as specified
103
+ if (lengthLimit && lengthLimit.length) {
104
+ var obeyLimit = false;
105
+ while (lengthLimit.length) {
106
+ if (lengthLimit.pop() == a.length)
107
+ obeyLimit = true;
108
+ }
109
+ if (!obeyLimit) {
110
+ alertTxt = message.complete;
111
+ return false;
112
+ }
113
+ }
114
+
115
+ if (pattern) {
116
+ var regex, jsRegex;
117
+ switch (pattern) {
118
+ case 'alphanumeric' :
119
+ regex = /^[a-z0-9]+$/i;
120
+ break;
121
+ case 'numeric' :
122
+ regex = /^[0-9]+$/i;
123
+ break;
124
+ case 'phone' :
125
+ regex = /^\+?([0-9]|[-|' '])+$/i;
126
+ break;
127
+ default :
128
+ regex = pattern;
129
+ }
130
+ try {
131
+ jsRegex = new RegExp(regex).test(a);
132
+ if (a && !jsRegex)
133
+ return false;
134
+ }
135
+ catch (err) {
136
+ console.log(err, field, 'regex is invalid');
137
+ return false;
138
+ }
139
+ }
140
+ return true;
141
+ },
142
+ number: function(a) {
143
+ // if not not a number
144
+ if (isNaN(parseFloat(a)) && !isFinite(a)) {
145
+ alertTxt = message.number;
146
+ return false;
147
+ }
148
+ // not enough numbers
149
+ else if (lengthRange && a.length < lengthRange[0]) {
150
+ alertTxt = message.min;
151
+ return false;
152
+ }
153
+ // check if there is max length & field length is greater than the allowed
154
+ else if (lengthRange && lengthRange[1] && a.length > lengthRange[1]) {
155
+ alertTxt = message.max;
156
+ return false;
157
+ }
158
+ else if (minmax[0] && (a | 0) < minmax[0]) {
159
+ alertTxt = message.number_min;
160
+ return false;
161
+ }
162
+ else if (minmax[1] && (a | 0) > minmax[1]) {
163
+ alertTxt = message.number_max;
164
+ return false;
165
+ }
166
+ return true;
167
+ },
168
+ // Date is validated in European format (day,month,year)
169
+ date: function(a) {
170
+ var day, A = a.split(/[-./]/g), i;
171
+ // if there is native HTML5 support:
172
+ if (field[0].valueAsNumber)
173
+ return true;
174
+
175
+ for (i = A.length; i--; ) {
176
+ if (isNaN(parseFloat(a)) && !isFinite(a))
177
+ return false;
178
+ }
179
+ try {
180
+ day = new Date(A[2], A[1] - 1, A[0]);
181
+ if (day.getMonth() + 1 == A[1] && day.getDate() == A[0])
182
+ return day;
183
+ return false;
184
+ }
185
+ catch (er) {
186
+ console.log('date test: ', err);
187
+ return false;
188
+ }
189
+ },
190
+ url: function(a) {
191
+ // minimalistic URL validation
192
+ function testUrl(url) {
193
+ return /^(https?:\/\/)?([\w\d\-_]+\.+[A-Za-z]{2,})+\/?/.test(url);
194
+ }
195
+ if (!testUrl(a)) {
196
+ console.log(a);
197
+ alertTxt = a ? message.url : message.empty;
198
+ return false;
199
+ }
200
+ return true;
201
+ },
202
+ hidden: function(a) {
203
+ if (lengthRange && a.length < lengthRange[0]) {
204
+ alertTxt = message.min;
205
+ return false;
206
+ }
207
+ if (pattern) {
208
+ var regex;
209
+ if (pattern == 'alphanumeric') {
210
+ regex = /^[a-z0-9]+$/i;
211
+ if (!regex.test(a)) {
212
+ return false;
213
+ }
214
+ }
215
+ }
216
+ return true;
217
+ },
218
+ select: function(a) {
219
+ if (!tests.hasValue(a)) {
220
+ alertTxt = message.select;
221
+ return false;
222
+ }
223
+ return true;
224
+ }
225
+ };
226
+
227
+ /* marks invalid fields
228
+ */
229
+ mark = function(field, text) {
230
+ if (!text || !field || !field.length)
231
+ return false;
232
+
233
+ // check if not already marked as a 'bad' record and add the 'alert' object.
234
+ // if already is marked as 'bad', then make sure the text is set again because it might change depending on validation
235
+ var item = field.parents('.item'),
236
+ warning;
237
+
238
+ if (item.hasClass('bad')) {
239
+ if (defaults.alerts)
240
+ item.find('.alert').html(text);
241
+ }
242
+ else if (defaults.alerts) {
243
+ warning = $('<div class="alert">').html(text);
244
+ item.append(warning);
245
+ }
246
+
247
+ item.removeClass('bad');
248
+ // a delay so the "alert" could be transitioned via CSS
249
+ setTimeout(function() {
250
+ item.addClass('bad');
251
+ }, 0);
252
+ };
253
+ /* un-marks invalid fields
254
+ */
255
+ unmark = function(field) {
256
+ if (!field || !field.length) {
257
+ console.warn('no "field" argument, null or DOM object not found');
258
+ return false;
259
+ }
260
+
261
+ field.parents('.item')
262
+ .removeClass('bad')
263
+ .find('.alert').remove();
264
+ };
265
+
266
+ function testByType(type, value) {
267
+ if (type == 'tel')
268
+ pattern = pattern || 'phone';
269
+
270
+ if (!type || type == 'password' || type == 'tel')
271
+ type = 'text';
272
+
273
+ return tests[type](value);
274
+ }
275
+
276
+ function prepareFieldData(el) {
277
+ field = $(el);
278
+
279
+ field.data('valid', true); // initialize validity of field
280
+ field.data('type', field.attr('type')); // every field starts as 'valid=true' until proven otherwise
281
+ pattern = field.attr('pattern');
282
+ }
283
+
284
+ /* Validations per-character keypress
285
+ */
286
+ function keypress(e) {
287
+ prepareFieldData(this);
288
+
289
+ if (e.charCode)
290
+ return testByType(this.type, String.fromCharCode(e.charCode));
291
+ }
292
+
293
+ /* Checks a single form field by it's type and specific (custom) attributes
294
+ */
295
+ function checkField() {
296
+ // skip testing fields whom their type is not HIDDEN but they are HIDDEN via CSS.
297
+ if (this.type != 'hidden' && $(this).is(':hidden'))
298
+ return true;
299
+
300
+ prepareFieldData(this);
301
+
302
+ field.data('val', field[0].value.replace(/^\s+|\s+$/g, "")); // cache the value of the field and trim it
303
+ data = field.data();
304
+
305
+ // Check if there is a specific error message for that field, if not, use the default 'invalid' message
306
+ alertTxt = message[field.prop('name')] || message.invalid;
307
+
308
+ // SELECT / TEXTAREA nodes needs special treatment
309
+ if (field[0].nodeName.toLowerCase() === "select") {
310
+ data.type = 'select';
311
+ }
312
+ if (field[0].nodeName.toLowerCase() === "textarea") {
313
+ data.type = 'text';
314
+ }
315
+ /* Gather Custom data attributes for specific validation:
316
+ */
317
+ validateWords = data['validateWords'] || 0;
318
+ lengthRange = data['validateLengthRange'] ? (data['validateLengthRange'] + '').split(',') : [1];
319
+ lengthLimit = data['validateLength'] ? (data['validateLength'] + '').split(',') : false;
320
+ minmax = data['validateMinmax'] ? (data['validateMinmax'] + '').split(',') : ''; // for type 'number', defines the minimum and/or maximum for the value as a number.
321
+
322
+ data.valid = tests.hasValue(data.val);
323
+ // check if field has any value
324
+ if (data.valid) {
325
+ /* Validate the field's value is different than the placeholder attribute (and attribute exists)
326
+ * this is needed when fixing the placeholders for older browsers which does not support them.
327
+ * in this case, make sure the "placeholder" jQuery plugin was even used before proceeding
328
+ */
329
+ if (tests.sameAsPlaceholder(field)) {
330
+ alertTxt = message.empty;
331
+ data.valid = false;
332
+ }
333
+
334
+ // if this field is linked to another field (their values should be the same)
335
+ if (data.validateLinked) {
336
+ var linkedTo = data['validateLinked'].indexOf('#') == 0 ? $(data['validateLinked']) : $(':input[name=' + data['validateLinked'] + ']');
337
+ data.valid = tests.linked(data.val, linkedTo.val());
338
+ }
339
+ /* validate by type of field. use 'attr()' is proffered to get the actual value and not what the browsers sees for unsupported types.
340
+ */
341
+ else if (data.valid || data.type == 'select')
342
+ data.valid = testByType(data.type, data.val);
343
+
344
+ // optional fields are only validated if they are not empty
345
+ if (field.hasClass('optional') && !data.val)
346
+ data.valid = true;
347
+ }
348
+
349
+ // mark / unmark the field, and set the general 'submit' flag accordingly
350
+ if (data.valid)
351
+ unmark(field);
352
+ else {
353
+ mark(field, alertTxt);
354
+ submit = false;
355
+ }
356
+
357
+ return data.valid;
358
+ }
359
+
360
+ /* vaildates all the REQUIRED fields prior to submiting the form
361
+ */
362
+ function checkAll($form) {
363
+ $form = $($form);
364
+
365
+ if ($form.length == 0) {
366
+ console.warn('element not found');
367
+ return false;
368
+ }
369
+
370
+ var that = this,
371
+ submit = true, // save the scope
372
+ fieldsToCheck = $form.find(':input').filter('[required=required], .required, .optional').not('[disabled=disabled]');
373
+
374
+ fieldsToCheck.each(function() {
375
+ // use an AND operation, so if any of the fields returns 'false' then the submitted result will be also FALSE
376
+ submit = submit * checkField.apply(this);
377
+ });
378
+
379
+ return !!submit; // casting the variable to make sure it's a boolean
380
+ }
381
+
382
+ return {
383
+ defaults: defaults,
384
+ checkField: checkField,
385
+ keypress: keypress,
386
+ checkAll: checkAll,
387
+ mark: mark,
388
+ unmark: unmark,
389
+ message: message,
390
+ tests: tests
391
+ }
392
+ })(jQuery);
files/js/wc-ajax.js ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function ($) {
2
+ var wc_home_url = $('#wc_home_url').val();
3
+ var wc_plugin_dir_url = $('#wc_plugin_dir_url').val();
4
+ var wc_name;
5
+ var wc_email;
6
+ var wc_comment;
7
+ var wc_captcha;
8
+ var wc_comment_post_ID;
9
+ var wc_comment_parent;
10
+ var wc_form;
11
+ var wc_submitID;
12
+ var wc_comments_offset;
13
+ var wc_new_comment_id;
14
+ var wc_loading_image;
15
+
16
+ $(".wc_comment").autoGrow();
17
+
18
+ $(document).delegate('#wc_openModalFormAction .close', 'click', function () {
19
+ $('#wc_openModalFormAction').css('opacity', '0');
20
+ $('#wc_openModalFormAction').css('pointer-events', 'none');
21
+ });
22
+
23
+ wc_loading_image = "<img width='64' height='64' src='" + wc_home_url + '/' + wc_plugin_dir_url + "/files/img/loader/ajax-loader-200x200.gif' />";
24
+ wc_comments_offset = $('#wc_comments_offset');
25
+ wc_comments_offset.val('1');
26
+
27
+ $(document).delegate('.wc_comment', 'focus', function () {
28
+ var uniqueID = getUniqueID($(this));
29
+ $('#wc-form-footer-' + uniqueID).slideDown(700);
30
+ });
31
+
32
+
33
+ $(document).delegate('.wc-reply-link', 'click', function () {
34
+ var uniqueID = getUniqueID($(this));
35
+ $('#wc-secondary-forms-wrapper-' + uniqueID).slideToggle(700);
36
+ });
37
+
38
+ $(document).delegate('.wc-share-link', 'click', function () {
39
+ var uniqueID = getUniqueID($(this));
40
+ $('#share_buttons_box-' + uniqueID).slideToggle(1000);
41
+ });
42
+
43
+ $(document).delegate('.wc_captcha_refresh_img', 'click', function () {
44
+ var uniqueID = getUniqueID($(this));
45
+ var wc_commpost_ID = $('#wc_comment_post_ID-' + uniqueID).val();
46
+ var wc_commparent = $('#wc_comment_parent-' + uniqueID).val();
47
+ $("#wc_captcha_img-" + uniqueID).attr("src", wc_home_url + "/" + wc_plugin_dir_url + "/captcha/captcha.php?comm_id=" + wc_commpost_ID + '-' + wc_commparent + '&r=' + Math.random());
48
+ });
49
+
50
+ $(document).delegate('.wc_comm_submit', 'click', function () {
51
+ wc_submitID = $(this).attr('id');
52
+ var uniqueID = wc_submitID.substring(wc_submitID.lastIndexOf('-') + 1);
53
+ wc_name = $('#wc_name-' + uniqueID).val();
54
+ wc_email = $('#wc_email-' + uniqueID).val();
55
+ wc_comment = $('textarea#wc_comment-' + uniqueID).val();
56
+ wc_captcha = $('#wc_captcha-' + uniqueID).val();
57
+ wc_comment_post_ID = $('#wc_comment_post_ID-' + uniqueID).val();
58
+ wc_comment_parent = $('#wc_comment_parent-' + uniqueID).val();
59
+ wc_form = $('#wc_comm_form-' + uniqueID);
60
+
61
+ var submit = true;
62
+ // evaluate the form using generic validaing
63
+ if (!validator.checkAll(wc_form)) {
64
+ submit = false;
65
+ } else {
66
+ $('#wc_openModalFormAction .close').css('display', 'none');
67
+ $('#wc_openModalFormAction').css('opacity', '1');
68
+ $('#wc_openModalFormAction').css('pointer-events', 'auto');
69
+ $('#wc_openModalFormAction > #wc_response_info').html(wc_loading_image);
70
+ }
71
+
72
+ if (submit) {
73
+ $.ajax({
74
+ type: 'POST',
75
+ url: wc_ajax_obj.url,
76
+ data: {
77
+ name: wc_name,
78
+ email: wc_email,
79
+ comment: wc_comment,
80
+ captcha: wc_captcha,
81
+ comment_post_ID: wc_comment_post_ID,
82
+ comment_parent: wc_comment_parent,
83
+ action: 'wc_comms_via_ajax'
84
+ }
85
+ }).done(function (response) {
86
+ $("#wc_captcha_img-" + uniqueID).attr("src", wc_home_url + "/" + wc_plugin_dir_url + "/captcha/captcha.php?comm_id=" + wc_comment_post_ID + '-' + wc_comment_parent + '&r=' + Math.random());
87
+ var obj = $.parseJSON(response);
88
+ wc_new_comment_id = parseInt(obj.wc_new_comment_id);
89
+ if (obj.code === -1) {
90
+ var html = "<a href='#close' title='Close' class='close'>&nbsp;</a>";
91
+ $('#wc_openModalFormAction').css('opacity', '1');
92
+ $('#wc_openModalFormAction').css('pointer-events', 'auto');
93
+ $('#wc_openModalFormAction .close').css('display', 'block');
94
+ $('#wc_openModalFormAction > #wc_response_info').html(html + obj.message);
95
+ } else if (obj.code === -2) {
96
+ var html = "<a href='#close' title='Close' class='close'>&nbsp;</a>";
97
+ $('#wc_openModalFormAction').css('opacity', '1');
98
+ $('#wc_openModalFormAction').css('pointer-events', 'auto');
99
+ $('#wc_openModalFormAction .close').css('display', 'block');
100
+ $('#wc_openModalFormAction > #wc_response_info').html(html + obj.message);
101
+ $('#wc_comment-' + uniqueID).val('');
102
+ $('.wc_comm_form textarea').css('height', '46px');
103
+
104
+ if (wc_submitID === 'wc_comm-' + wc_comment_post_ID + '_0') {
105
+ $('#wc-form-footer-' + uniqueID).slideToggle(700);
106
+ } else {
107
+ $('#wc-secondary-forms-wrapper-' + uniqueID).slideToggle(700);
108
+ }
109
+ if (wc_new_comment_id !== -1) {
110
+ emailNotification(wc_comment_parent, wc_new_comment_id);
111
+ }
112
+ $.cookie('wc_author_name', wc_name);
113
+ $.cookie('wc_author_email', wc_email);
114
+ } else {
115
+ $('#wc_comment-' + uniqueID).val('');
116
+ $('.wc_comm_form textarea').css('height', '46px');
117
+
118
+ if (wc_submitID === 'wc_comm-' + wc_comment_post_ID + '_0') {
119
+ $('.wc-thread-wrapper').prepend(obj.message);
120
+ $('#wc-form-footer-' + uniqueID).slideToggle(700);
121
+ } else {
122
+ $('#wc-secondary-forms-wrapper-' + uniqueID).slideToggle(700);
123
+
124
+ if ($('#wc-comm-' + uniqueID).hasClass('wc-reply')) {
125
+ $('#wc-secondary-forms-wrapper-' + uniqueID).after(obj.message.replace('wc-reply', 'wc-reply wc-no-left-margin'));
126
+ } else {
127
+ $('#wc-secondary-forms-wrapper-' + uniqueID).after(obj.message);
128
+ }
129
+ }
130
+ $('#wc_openModalFormAction').css('opacity', '0');
131
+ $('#wc_openModalFormAction').css('pointer-events', 'none');
132
+ if (wc_name !== '' && wc_email !== '') {
133
+ $.cookie('wc_author_name', wc_name);
134
+ $.cookie('wc_author_email', wc_email);
135
+ $('#wpcomm .wc_name').val(wc_name);
136
+ $('#wpcomm .wc_email').val(wc_email);
137
+ }
138
+ if (wc_new_comment_id !== -1) {
139
+ emailNotification(wc_comment_parent, wc_new_comment_id);
140
+ }
141
+ }
142
+ $('#wc_captcha-' + uniqueID).val('');
143
+ $('.wc_tooltipster').tooltipster({offsetY: 2});
144
+ $('.wc_comm_form input').css('box-shadow', '0 0 4px -2px #d4d0ba');
145
+ $('.wc_comm_form textarea').css('box-shadow', '0 0 4px -2px #d4d0ba');
146
+ });
147
+ }
148
+ else {
149
+ return false;
150
+ }
151
+ });
152
+
153
+
154
+
155
+ $(document).delegate('.wc_vote', 'click', function () {
156
+ var uniqueID = getUniqueID($(this));
157
+ var commentID = getCommentID(uniqueID);
158
+ var voteType;
159
+
160
+ $('#wc_openModalFormAction > #wc_response_info').html(wc_loading_image);
161
+ $('#wc_openModalFormAction .close').css('display', 'block');
162
+ $('#wc_openModalFormAction').css('opacity', '1');
163
+ $('#wc_openModalFormAction').css('pointer-events', 'auto');
164
+ if ($(this).hasClass('wc-up')) {
165
+ voteType = 1;
166
+ } else {
167
+ voteType = -1;
168
+ }
169
+
170
+ $.ajax({
171
+ dateType: 'json',
172
+ type: 'POST',
173
+ url: wc_ajax_obj.url,
174
+ data: {
175
+ comment_ID: commentID,
176
+ vote_type: voteType,
177
+ action: 'wc_vote_via_ajax'
178
+ }
179
+ }).done(function (response) {
180
+ var obj = $.parseJSON(response);
181
+
182
+ if (obj.code !== -1) {
183
+ $('#vote-count-' + uniqueID).text(parseInt($('#vote-count-' + uniqueID).text()) + voteType);
184
+ $('#wc_openModalFormAction').css('opacity', '0');
185
+ $('#wc_openModalFormAction').css('pointer-events', 'none');
186
+ } else {
187
+ var html = "<a href='#close' title='Close' class='close'>&nbsp;</a>";
188
+ $('#wc_response_info').html(html + obj.message);
189
+ $('#wc_openModalFormAction .close').css('display', 'block');
190
+ }
191
+ });
192
+ });
193
+
194
+ $(document).delegate('.wc-load-more-submit', 'click', function () {
195
+ $('#wc_openModalFormAction > #wc_response_info').html(wc_loading_image);
196
+ $('#wc_openModalFormAction .close').css('display', 'none');
197
+ $('#wc_openModalFormAction').css('opacity', '1');
198
+ $('#wc_openModalFormAction').css('pointer-events', 'auto');
199
+
200
+ var wc_comments_offset_value = wc_comments_offset.val();
201
+ var wc_post_id = getPostID($(this).attr('id'));
202
+ var wc_parent_comments_count = parseInt($('#wc_parent_comments_count').val());
203
+ var wc_parent_per_page = parseInt($('#wc_parent_per_page').val());
204
+
205
+ wc_comments_offset_value = parseInt(wc_comments_offset_value);
206
+ wc_comments_offset_value++;
207
+
208
+ $.ajax({
209
+ type: 'POST',
210
+ url: wc_ajax_obj.url,
211
+ data: {
212
+ comments_offset: wc_comments_offset_value,
213
+ wc_post_id: wc_post_id,
214
+ action: 'wc_load_more_comments'
215
+ }
216
+ }).done(function (response) {
217
+ wc_comments_offset.val(wc_comments_offset_value);
218
+ if (wc_parent_comments_count <= (wc_comments_offset_value * wc_parent_per_page)) {
219
+ $('.wc-load-more-submit-wrap').remove();
220
+ }
221
+ $('.wc-thread-wrapper').html(response);
222
+ $('#wc_openModalFormAction').css('opacity', '0');
223
+ $('#wc_openModalFormAction').css('pointer-events', 'none');
224
+ $('.wc_tooltipster').tooltipster({offsetY: 2});
225
+ });
226
+ });
227
+
228
+ function getUniqueID(field) {
229
+ var fieldID = field.attr('id');
230
+ var uniqueID = fieldID.substring(fieldID.lastIndexOf('-') + 1);
231
+ return uniqueID;
232
+ }
233
+
234
+ function getPostID(uniqueID) {
235
+ var postID = uniqueID.substring(uniqueID.lastIndexOf('-') + 1);
236
+ postID = postID.substring(0, postID.lastIndexOf('_'));
237
+ return postID;
238
+ }
239
+
240
+ function getCommentID(uniqueID) {
241
+ var commentID = uniqueID.substring(uniqueID.indexOf('_') + 1);
242
+ return commentID;
243
+ }
244
+
245
+ function emailNotification(wc_comment_parent, wc_new_comment_id) {
246
+ $.ajax({
247
+ type: 'POST',
248
+ url: wc_ajax_obj.url,
249
+ data: {
250
+ wc_comment_parent: wc_comment_parent,
251
+ wc_new_comment_id: wc_new_comment_id,
252
+ action: 'email_notification'
253
+ }
254
+ });
255
+ }
256
+
257
+ $('.wc_tooltipster').tooltipster({offsetY: 2});
258
+ });
files/js/wc-scripts.js ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function ($) {
2
+ var pickerImg1 = $('.wc_colorpicker_img1');
3
+ var modalBox1 = $('div#wc_box1');
4
+ var position1 = pickerImg1.position();
5
+ /*modalBox1.css('margin-left', position1.left + 200);*/
6
+
7
+ $('#wc_colorpickerHolder1').ColorPicker({
8
+ flat: true,
9
+ onChange: function (hsb, hex, rgb) {
10
+ $('#wc_comment_bg_color').val('#' + hex);
11
+ }
12
+ });
13
+
14
+ $('#wc_colorpickerHolder2').ColorPicker({
15
+ flat: true,
16
+ onChange: function (hsb, hex, rgb) {
17
+ $('#wc_reply_bg_color').val('#' + hex);
18
+ }
19
+ });
20
+
21
+ $('#wc_colorpickerHolder3').ColorPicker({
22
+ flat: true,
23
+ onChange: function (hsb, hex, rgb) {
24
+ $('#wc_comment_text_color').val('#' + hex);
25
+ }
26
+ });
27
+
28
+ $('#wc_colorpickerHolder4').ColorPicker({
29
+ flat: true,
30
+ onChange: function (hsb, hex, rgb) {
31
+ $('#wc_author_title_color').val('#' + hex);
32
+ }
33
+ });
34
+
35
+ $('#wc_colorpickerHolder5').ColorPicker({
36
+ flat: true,
37
+ onChange: function (hsb, hex, rgb) {
38
+ $('#wc_vote_reply_color').val('#' + hex);
39
+ }
40
+ });
41
+ });
files/third-party/colorpicker/css/colorpicker.css ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .colorpicker {
2
+ width: 356px;
3
+ height: 176px;
4
+ overflow: hidden;
5
+ position: absolute;
6
+ background: url(../img/colorpicker_background.png);
7
+ font-family: Arial, Helvetica, sans-serif;
8
+ display: none;
9
+ }
10
+ .colorpicker_color {
11
+ width: 150px;
12
+ height: 150px;
13
+ left: 14px;
14
+ top: 13px;
15
+ position: absolute;
16
+ background: #f00;
17
+ overflow: hidden;
18
+ cursor: crosshair;
19
+ }
20
+ .colorpicker_color div {
21
+ position: absolute;
22
+ top: 0;
23
+ left: 0;
24
+ width: 150px;
25
+ height: 150px;
26
+ background: url(../img/colorpicker_overlay.png);
27
+ }
28
+ .colorpicker_color div div {
29
+ position: absolute;
30
+ top: 0;
31
+ left: 0;
32
+ width: 11px;
33
+ height: 11px;
34
+ overflow: hidden;
35
+ background: url(../img/colorpicker_select.gif);
36
+ margin: -5px 0 0 -5px;
37
+ }
38
+ .colorpicker_hue {
39
+ position: absolute;
40
+ top: 13px;
41
+ left: 171px;
42
+ width: 35px;
43
+ height: 150px;
44
+ cursor: n-resize;
45
+ }
46
+ .colorpicker_hue div {
47
+ position: absolute;
48
+ width: 35px;
49
+ height: 9px;
50
+ overflow: hidden;
51
+ background: url(../img/colorpicker_indic.gif) left top;
52
+ margin: -4px 0 0 0;
53
+ left: 0px;
54
+ }
55
+ .colorpicker_new_color {
56
+ position: absolute;
57
+ width: 60px;
58
+ height: 30px;
59
+ left: 213px;
60
+ top: 13px;
61
+ background: #f00;
62
+ }
63
+ .colorpicker_current_color {
64
+ position: absolute;
65
+ width: 60px;
66
+ height: 30px;
67
+ left: 283px;
68
+ top: 13px;
69
+ background: #f00;
70
+ }
71
+ .colorpicker input {
72
+ background-color: transparent;
73
+ border: 1px solid transparent;
74
+ position: absolute;
75
+ font-size: 10px;
76
+ font-family: Arial, Helvetica, sans-serif;
77
+ color: #898989;
78
+ top: 4px;
79
+ right: 11px;
80
+ text-align: right;
81
+ margin: 0;
82
+ padding: 0;
83
+ height: 11px;
84
+ }
85
+ .colorpicker_hex {
86
+ position: absolute;
87
+ width: 72px;
88
+ height: 22px;
89
+ background: url(../img/colorpicker_hex.png) top;
90
+ left: 212px;
91
+ top: 142px;
92
+ }
93
+ .colorpicker_hex input {
94
+ right: 6px;
95
+ }
96
+ .colorpicker_field {
97
+ height: 22px;
98
+ width: 62px;
99
+ background-position: top;
100
+ position: absolute;
101
+ }
102
+ .colorpicker_field span {
103
+ position: absolute;
104
+ width: 12px;
105
+ height: 22px;
106
+ overflow: hidden;
107
+ top: 0;
108
+ right: 0;
109
+ cursor: n-resize;
110
+ }
111
+ .colorpicker_rgb_r {
112
+ background-image: url(../img/colorpicker_rgb_r.png);
113
+ top: 52px;
114
+ left: 212px;
115
+ }
116
+ .colorpicker_rgb_g {
117
+ background-image: url(../img/colorpicker_rgb_g.png);
118
+ top: 82px;
119
+ left: 212px;
120
+ }
121
+ .colorpicker_rgb_b {
122
+ background-image: url(../img/colorpicker_rgb_b.png);
123
+ top: 112px;
124
+ left: 212px;
125
+ }
126
+ .colorpicker_hsb_h {
127
+ background-image: url(../img/colorpicker_hsb_h.png);
128
+ top: 52px;
129
+ left: 282px;
130
+ }
131
+ .colorpicker_hsb_s {
132
+ background-image: url(../img/colorpicker_hsb_s.png);
133
+ top: 82px;
134
+ left: 282px;
135
+ }
136
+ .colorpicker_hsb_b {
137
+ background-image: url(../img/colorpicker_hsb_b.png);
138
+ top: 112px;
139
+ left: 282px;
140
+ }
141
+ .colorpicker_submit {
142
+ position: absolute;
143
+ width: 22px;
144
+ height: 22px;
145
+ background: url(../img/colorpicker_submit.png) top;
146
+ left: 322px;
147
+ top: 142px;
148
+ overflow: hidden;
149
+ }
150
+ .colorpicker_focus {
151
+ background-position: center;
152
+ }
153
+ .colorpicker_hex.colorpicker_focus {
154
+ background-position: bottom;
155
+ }
156
+ .colorpicker_submit.colorpicker_focus {
157
+ background-position: bottom;
158
+ }
159
+ .colorpicker_slider {
160
+ background-position: bottom;
161
+ }
files/third-party/colorpicker/img/blank.gif ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_background.png ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_hex.png ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_hsb_b.png ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_hsb_h.png ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_hsb_s.png ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_icon.jpg ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_icon_22.png ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_icon_256.png ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_icon_30.png ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_indic.gif ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_overlay.png ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_rgb_b.png ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_rgb_g.png ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_rgb_r.png ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_select.gif ADDED
Binary file
files/third-party/colorpicker/img/colorpicker_submit.png ADDED
Binary file
files/third-party/colorpicker/img/custom_background.png ADDED
Binary file
files/third-party/colorpicker/img/custom_hex.png ADDED
Binary file
files/third-party/colorpicker/img/custom_hsb_b.png ADDED
Binary file
files/third-party/colorpicker/img/custom_hsb_h.png ADDED
Binary file
files/third-party/colorpicker/img/custom_hsb_s.png ADDED
Binary file
files/third-party/colorpicker/img/custom_indic.gif ADDED
Binary file
files/third-party/colorpicker/img/custom_rgb_b.png ADDED
Binary file
files/third-party/colorpicker/img/custom_rgb_g.png ADDED
Binary file
files/third-party/colorpicker/img/custom_rgb_r.png ADDED
Binary file
files/third-party/colorpicker/img/custom_submit.png ADDED
Binary file
files/third-party/colorpicker/js/colorpicker.js ADDED
@@ -0,0 +1,529 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * Color picker
4
+ * Author: Stefan Petre www.eyecon.ro
5
+ *
6
+ * Dual licensed under the MIT and GPL licenses
7
+ *
8
+ */
9
+ (function ($) {
10
+ var ColorPicker = function () {
11
+ var
12
+ ids = {},
13
+ inAction,
14
+ charMin = 65,
15
+ visible,
16
+ tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
17
+ defaults = {
18
+ eventName: 'click',
19
+ onShow: function () {},
20
+ onBeforeShow: function(){},
21
+ onHide: function () {},
22
+ onChange: function () {},
23
+ onSubmit: function () {},
24
+ color: 'ff0000',
25
+ livePreview: true,
26
+ flat: false
27
+ },
28
+ fillRGBFields = function (hsb, cal) {
29
+ var rgb = HSBToRGB(hsb);
30
+ $(cal).data('colorpicker').fields
31
+ .eq(1).val(rgb.r).end()
32
+ .eq(2).val(rgb.g).end()
33
+ .eq(3).val(rgb.b).end();
34
+ },
35
+ fillHSBFields = function (hsb, cal) {
36
+ $(cal).data('colorpicker').fields
37
+ .eq(4).val(hsb.h).end()
38
+ .eq(5).val(hsb.s).end()
39
+ .eq(6).val(hsb.b).end();
40
+ },
41
+ fillHexFields = function (hsb, cal) {
42
+ $(cal).data('colorpicker').fields
43
+ .eq(0).val(HSBToHex(hsb)).end();
44
+ },
45
+ setSelector = function (hsb, cal) {
46
+ $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({
47
+ h: hsb.h,
48
+ s: 100,
49
+ b: 100
50
+ }));
51
+ $(cal).data('colorpicker').selectorIndic.css({
52
+ left: parseInt(150 * hsb.s/100, 10),
53
+ top: parseInt(150 * (100-hsb.b)/100, 10)
54
+ });
55
+ },
56
+ setHue = function (hsb, cal) {
57
+ $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
58
+ },
59
+ setCurrentColor = function (hsb, cal) {
60
+ $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
61
+ },
62
+ setNewColor = function (hsb, cal) {
63
+ $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
64
+ },
65
+ keyDown = function (ev) {
66
+ var pressedKey = ev.charCode || ev.keyCode || -1;
67
+ if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
68
+ return false;
69
+ }
70
+ var cal = $(this).parent().parent();
71
+ if (cal.data('colorpicker').livePreview === true) {
72
+ change.apply(this);
73
+ }
74
+ },
75
+ change = function (ev) {
76
+ var cal = $(this).parent().parent(), col;
77
+ if (this.parentNode.className.indexOf('_hex') > 0) {
78
+ cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
79
+ } else if (this.parentNode.className.indexOf('_hsb') > 0) {
80
+ cal.data('colorpicker').color = col = fixHSB({
81
+ h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
82
+ s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
83
+ b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
84
+ });
85
+ } else {
86
+ cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
87
+ r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
88
+ g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
89
+ b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
90
+ }));
91
+ }
92
+ if (ev) {
93
+ fillRGBFields(col, cal.get(0));
94
+ fillHexFields(col, cal.get(0));
95
+ fillHSBFields(col, cal.get(0));
96
+ }
97
+ setSelector(col, cal.get(0));
98
+ setHue(col, cal.get(0));
99
+ setNewColor(col, cal.get(0));
100
+ cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
101
+ },
102
+ blur = function (ev) {
103
+ var cal = $(this).parent().parent();
104
+ cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
105
+ },
106
+ focus = function () {
107
+ charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
108
+ $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
109
+ $(this).parent().addClass('colorpicker_focus');
110
+ },
111
+ downIncrement = function (ev) {
112
+ var field = $(this).parent().find('input').focus();
113
+ var current = {
114
+ el: $(this).parent().addClass('colorpicker_slider'),
115
+ max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
116
+ y: ev.pageY,
117
+ field: field,
118
+ val: parseInt(field.val(), 10),
119
+ preview: $(this).parent().parent().data('colorpicker').livePreview
120
+ };
121
+ $(document).bind('mouseup', current, upIncrement);
122
+ $(document).bind('mousemove', current, moveIncrement);
123
+ },
124
+ moveIncrement = function (ev) {
125
+ ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
126
+ if (ev.data.preview) {
127
+ change.apply(ev.data.field.get(0), [true]);
128
+ }
129
+ return false;
130
+ },
131
+ upIncrement = function (ev) {
132
+ change.apply(ev.data.field.get(0), [true]);
133
+ ev.data.el.removeClass('colorpicker_slider').find('input').focus();
134
+ $(document).unbind('mouseup', upIncrement);
135
+ $(document).unbind('mousemove', moveIncrement);
136
+ return false;
137
+ },
138
+ downHue = function (ev) {
139
+ var current = {
140
+ cal: $(this).parent(),
141
+ y: $(this).offset().top
142
+ };
143
+ current.preview = current.cal.data('colorpicker').livePreview;
144
+ $(document).bind('mouseup', current, upHue);
145
+ $(document).bind('mousemove', current, moveHue);
146
+ },
147
+ moveHue = function (ev) {
148
+ change.apply(
149
+ ev.data.cal.data('colorpicker')
150
+ .fields
151
+ .eq(4)
152
+ .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
153
+ .get(0),
154
+ [ev.data.preview]
155
+ );
156
+ return false;
157
+ },
158
+ upHue = function (ev) {
159
+ fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
160
+ fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
161
+ $(document).unbind('mouseup', upHue);
162
+ $(document).unbind('mousemove', moveHue);
163
+ return false;
164
+ },
165
+ downSelector = function (ev) {
166
+ var current = {
167
+ cal: $(this).parent(),
168
+ pos: $(this).offset()
169
+ };
170
+ current.preview = current.cal.data('colorpicker').livePreview;
171
+ $(document).bind('mouseup', current, upSelector);
172
+ $(document).bind('mousemove', current, moveSelector);
173
+ },
174
+ moveSelector = function (ev) {
175
+ change.apply(
176
+ ev.data.cal.data('colorpicker')
177
+ .fields
178
+ .eq(6)
179
+ .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
180
+ .end()
181
+ .eq(5)
182
+ .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
183
+ .get(0),
184
+ [ev.data.preview]
185
+ );
186
+ return false;
187
+ },
188
+ upSelector = function (ev) {
189
+ fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
190
+ fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
191
+ $(document).unbind('mouseup', upSelector);
192
+ $(document).unbind('mousemove', moveSelector);
193
+ return false;
194
+ },
195
+ enterSubmit = function (ev) {
196
+ $(this).addClass('colorpicker_focus');
197
+ },
198
+ leaveSubmit = function (ev) {
199
+ $(this).removeClass('colorpicker_focus');
200
+ },
201
+ clickSubmit = function (ev) {
202
+ var cal = $(this).parent();
203
+ var col = cal.data('colorpicker').color;
204
+ cal.data('colorpicker').origColor = col;
205
+ setCurrentColor(col, cal.get(0));
206
+ cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
207
+ },
208
+ show = function (ev) {
209
+ var cal = $('#' + $(this).data('colorpickerId'));
210
+ cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
211
+ var pos = $(this).offset();
212
+ var viewPort = getViewport();
213
+ var top = pos.top + this.offsetHeight;
214
+ var left = pos.left;
215
+ if (top + 176 > viewPort.t + viewPort.h) {
216
+ top -= this.offsetHeight + 176;
217
+ }
218
+ if (left + 356 > viewPort.l + viewPort.w) {
219
+ left -= 356;
220
+ }
221
+ cal.css({
222
+ left: left + 'px',
223
+ top: top + 'px'
224
+ });
225
+ if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
226
+ cal.show();
227
+ }
228
+ $(document).bind('mousedown', {
229
+ cal: cal
230
+ }, hide);
231
+ return false;
232
+ },
233
+ hide = function (ev) {
234
+ if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
235
+ if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
236
+ ev.data.cal.hide();
237
+ }
238
+ $(document).unbind('mousedown', hide);
239
+ }
240
+ },
241
+ isChildOf = function(parentEl, el, container) {
242
+ if (parentEl == el) {
243
+ return true;
244
+ }
245
+ if (parentEl.contains) {
246
+ return parentEl.contains(el);
247
+ }
248
+ if ( parentEl.compareDocumentPosition ) {
249
+ return !!(parentEl.compareDocumentPosition(el) & 16);
250
+ }
251
+ var prEl = el.parentNode;
252
+ while(prEl && prEl != container) {
253
+ if (prEl == parentEl)
254
+ return true;
255
+ prEl = prEl.parentNode;
256
+ }
257
+ return false;
258
+ },
259
+ getViewport = function () {
260
+ var m = document.compatMode == 'CSS1Compat';
261
+ return {
262
+ l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
263
+ t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
264
+ w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
265
+ h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
266
+ };
267
+ },
268
+ fixHSB = function (hsb) {
269
+ return {
270
+ h: Math.min(360, Math.max(0, hsb.h)),
271
+ s: Math.min(100, Math.max(0, hsb.s)),
272
+ b: Math.min(100, Math.max(0, hsb.b))
273
+ };
274
+ },
275
+ fixRGB = function (rgb) {
276
+ return {
277
+ r: Math.min(255, Math.max(0, rgb.r)),
278
+ g: Math.min(255, Math.max(0, rgb.g)),
279
+ b: Math.min(255, Math.max(0, rgb.b))
280
+ };
281
+ },
282
+ fixHex = function (hex) {
283
+ var len = 6 - hex.length;
284
+ if (len > 0) {
285
+ var o = [];
286
+ for (var i=0; i<len; i++) {
287
+ o.push('0');
288
+ }
289
+ o.push(hex);
290
+ hex = o.join('');
291
+ }
292
+ return hex;
293
+ },
294
+ HexToRGB = function (hex) {
295
+ var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
296
+ return {
297
+ r: hex >> 16,
298
+ g: (hex & 0x00FF00) >> 8,
299
+ b: (hex & 0x0000FF)
300
+ };
301
+ },
302
+ HexToHSB = function (hex) {
303
+ return RGBToHSB(HexToRGB(hex));
304
+ },
305
+ RGBToHSB = function (rgb) {
306
+ var hsb = {
307
+ h: 0,
308
+ s: 0,
309
+ b: 0
310
+ };
311
+ var min = Math.min(rgb.r, rgb.g, rgb.b);
312
+ var max = Math.max(rgb.r, rgb.g, rgb.b);
313
+ var delta = max - min;
314
+ hsb.b = max;
315
+ if (max != 0) {
316
+
317
+ }
318
+ hsb.s = max != 0 ? 255 * delta / max : 0;
319
+ if (hsb.s != 0) {
320
+ if (rgb.r == max) {
321
+ hsb.h = (rgb.g - rgb.b) / delta;
322
+ } else if (rgb.g == max) {
323
+ hsb.h = 2 + (rgb.b - rgb.r) / delta;
324
+ } else {
325
+ hsb.h = 4 + (rgb.r - rgb.g) / delta;
326
+ }
327
+ } else {
328
+ hsb.h = -1;
329
+ }
330
+ hsb.h *= 60;
331
+ if (hsb.h < 0) {
332
+ hsb.h += 360;
333
+ }
334
+ hsb.s *= 100/255;
335
+ hsb.b *= 100/255;
336
+ return hsb;
337
+ },
338
+ HSBToRGB = function (hsb) {
339
+ var rgb = {};
340
+ var h = Math.round(hsb.h);
341
+ var s = Math.round(hsb.s*255/100);
342
+ var v = Math.round(hsb.b*255/100);
343
+ if(s == 0) {
344
+ rgb.r = rgb.g = rgb.b = v;
345
+ } else {
346
+ var t1 = v;
347
+ var t2 = (255-s)*v/255;
348
+ var t3 = (t1-t2)*(h%60)/60;
349
+ if(h==360) h = 0;
350
+ if(h<60) {
351
+ rgb.r=t1;
352
+ rgb.b=t2;
353
+ rgb.g=t2+t3
354
+ }
355
+ else if(h<120) {
356
+ rgb.g=t1;
357
+ rgb.b=t2;
358
+ rgb.r=t1-t3
359
+ }
360
+ else if(h<180) {
361
+ rgb.g=t1;
362
+ rgb.r=t2;
363
+ rgb.b=t2+t3
364
+ }
365
+ else if(h<240) {
366
+ rgb.b=t1;
367
+ rgb.r=t2;
368
+ rgb.g=t1-t3
369
+ }
370
+ else if(h<300) {
371
+ rgb.b=t1;
372
+ rgb.g=t2;
373
+ rgb.r=t2+t3
374
+ }
375
+ else if(h<360) {
376
+ rgb.r=t1;
377
+ rgb.g=t2;
378
+ rgb.b=t1-t3
379
+ }
380
+ else {
381
+ rgb.r=0;
382
+ rgb.g=0;
383
+ rgb.b=0
384
+ }
385
+ }
386
+ return {
387
+ r:Math.round(rgb.r),
388
+ g:Math.round(rgb.g),
389
+ b:Math.round(rgb.b)
390
+ };
391
+ },
392
+ RGBToHex = function (rgb) {
393
+ var hex = [
394
+ rgb.r.toString(16),
395
+ rgb.g.toString(16),
396
+ rgb.b.toString(16)
397
+ ];
398
+ $.each(hex, function (nr, val) {
399
+ if (val.length == 1) {
400
+ hex[nr] = '0' + val;
401
+ }
402
+ });
403
+ return hex.join('');
404
+ },
405
+ HSBToHex = function (hsb) {
406
+ return RGBToHex(HSBToRGB(hsb));
407
+ },
408
+ restoreOriginal = function () {
409
+ var cal = $(this).parent();
410
+ var col = cal.data('colorpicker').origColor;
411
+ cal.data('colorpicker').color = col;
412
+ fillRGBFields(col, cal.get(0));
413
+ fillHexFields(col, cal.get(0));
414
+ fillHSBFields(col, cal.get(0));
415
+ setSelector(col, cal.get(0));
416
+ setHue(col, cal.get(0));
417
+ setNewColor(col, cal.get(0));
418
+ };
419
+ return {
420
+ init: function (opt) {
421
+ opt = $.extend({}, defaults, opt||{});
422
+ if (typeof opt.color == 'string') {
423
+ opt.color = HexToHSB(opt.color);
424
+ } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
425
+ opt.color = RGBToHSB(opt.color);
426
+ } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
427
+ opt.color = fixHSB(opt.color);
428
+ } else {
429
+ return this;
430
+ }
431
+ return this.each(function () {
432
+ if (!$(this).data('colorpickerId')) {
433
+ var options = $.extend({}, opt);
434
+ options.origColor = opt.color;
435
+ var id = 'collorpicker_' + parseInt(Math.random() * 1000);
436
+ $(this).data('colorpickerId', id);
437
+ var cal = $(tpl).attr('id', id);
438
+ if (options.flat) {
439
+ cal.appendTo(this).show();
440
+ } else {
441
+ cal.appendTo(document.body);
442
+ }
443
+ options.fields = cal
444
+ .find('input')
445
+ .bind('keyup', keyDown)
446
+ .bind('change', change)
447
+ .bind('blur', blur)
448
+ .bind('focus', focus);
449
+ cal
450
+ .find('span').bind('mousedown', downIncrement).end()
451
+ .find('>div.colorpicker_current_color').bind('click', restoreOriginal);
452
+ options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
453
+ options.selectorIndic = options.selector.find('div div');
454
+ options.el = this;
455
+ options.hue = cal.find('div.colorpicker_hue div');
456
+ cal.find('div.colorpicker_hue').bind('mousedown', downHue);
457
+ options.newColor = cal.find('div.colorpicker_new_color');
458
+ options.currentColor = cal.find('div.colorpicker_current_color');
459
+ cal.data('colorpicker', options);
460
+ cal.find('div.colorpicker_submit')
461
+ .bind('mouseenter', enterSubmit)
462
+ .bind('mouseleave', leaveSubmit)
463
+ .bind('click', clickSubmit);
464
+ fillRGBFields(options.color, cal.get(0));
465
+ fillHSBFields(options.color, cal.get(0));
466
+ fillHexFields(options.color, cal.get(0));
467
+ setHue(options.color, cal.get(0));
468
+ setSelector(options.color, cal.get(0));
469
+ setCurrentColor(options.color, cal.get(0));
470
+ setNewColor(options.color, cal.get(0));
471
+ if (options.flat) {
472
+ cal.css({
473
+ position: 'relative',
474
+ display: 'block'
475
+ });
476
+ } else {
477
+ $(this).bind(options.eventName, show);
478
+ }
479
+ }
480
+ });
481
+ },
482
+ showPicker: function() {
483
+ return this.each( function () {
484
+ if ($(this).data('colorpickerId')) {
485
+ show.apply(this);
486
+ }
487
+ });
488
+ },
489
+ hidePicker: function() {
490
+ return this.each( function () {
491
+ if ($(this).data('colorpickerId')) {
492
+ $('#' + $(this).data('colorpickerId')).hide();
493
+ }
494
+ });
495
+ },
496
+ setColor: function(col) {
497
+ if (typeof col == 'string') {
498
+ col = HexToHSB(col);
499
+ } else if (col.r != undefined && col.g != undefined && col.b != undefined) {
500
+ col = RGBToHSB(col);
501
+ } else if (col.h != undefined && col.s != undefined && col.b != undefined) {
502
+ col = fixHSB(col);
503
+ } else {
504
+ return this;
505
+ }
506
+ return this.each(function(){
507
+ if ($(this).data('colorpickerId')) {
508
+ var cal = $('#' + $(this).data('colorpickerId'));
509
+ cal.data('colorpicker').color = col;
510
+ cal.data('colorpicker').origColor = col;
511
+ fillRGBFields(col, cal.get(0));
512
+ fillHSBFields(col, cal.get(0));
513
+ fillHexFields(col, cal.get(0));
514
+ setHue(col, cal.get(0));
515
+ setSelector(col, cal.get(0));
516
+ setCurrentColor(col, cal.get(0));
517
+ setNewColor(col, cal.get(0));
518
+ }
519
+ });
520
+ }
521
+ };
522
+ }();
523
+ $.fn.extend({
524
+ ColorPicker: ColorPicker.init,
525
+ ColorPickerHide: ColorPicker.hidePicker,
526
+ ColorPickerShow: ColorPicker.showPicker,
527
+ ColorPickerSetColor: ColorPicker.setColor
528
+ });
529
+ })(jQuery)
files/third-party/modal-box/modal-box-ie.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /*the colorpicker dialog style in IE*/
2
+ .modalDialog {
3
+ display:none;
4
+ }
5
+
6
+ .modalDialog:target {
7
+ display:block;
8
+ }
files/third-party/modal-box/modal-box.css ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /*= MODAL DIALOG BOX =*/
3
+
4
+ .modalDialog {
5
+ position: fixed;
6
+ font-family: Arial, Helvetica, sans-serif;
7
+ top: 0;
8
+ right: 0;
9
+ bottom: 0;
10
+ left: 0;
11
+ background: rgba(0,0,0,0.4);
12
+ z-index: 99999;
13
+ opacity:0;
14
+ -webkit-transition: opacity 400ms ease-in;
15
+ -moz-transition: opacity 400ms ease-in;
16
+ transition: opacity 400ms ease-in;
17
+ pointer-events: none;
18
+ }
19
+
20
+ .modalDialog:target {
21
+ opacity:1;
22
+ pointer-events: auto;
23
+ }
24
+
25
+ .modalDialog > div {
26
+ width: 400px;
27
+ position: relative;
28
+ margin: 10% auto;
29
+ padding: 5px 20px 13px 20px;
30
+ -webkit-border-top-left-radius: 10px;
31
+ -webkit-border-top-right-radius: 10px;
32
+ -webkit-border-bottom-right-radius: 10px;
33
+ -webkit-border-bottom-left-radius: 10px;
34
+
35
+ -moz-border-radius-topleft: 10px;
36
+ -moz-border-radius-topright: 10px;
37
+ -moz-border-radius-bottomright: 10px;
38
+ -moz-border-radius-bottomleft: 10px;
39
+
40
+ border-top-left-radius: 10px;
41
+ border-top-right-radius: 10px;
42
+ border-bottom-right-radius: 10px;
43
+ border-bottom-left-radius: 10px;
44
+ background: #fff;
45
+ background: -moz-linear-gradient(#fff, #999);
46
+ background: -webkit-linear-gradient(#fff, #999);
47
+ background: -o-linear-gradient(#fff, #999);
48
+ background: -ms-linear-gradient(#fff, #999);
49
+ background: linear-gradient(#fff, #999);
50
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#999999');
51
+ }
52
+
53
+ .close {
54
+ background: #606061;
55
+ color: #FFFFFF;
56
+ line-height: 25px;
57
+ position: absolute;
58
+ right: -12px;
59
+ text-align: center;
60
+ top: -10px;
61
+ width: 24px;
62
+ text-decoration: none;
63
+ font-weight: bold;
64
+ -webkit-border-radius: 12px;
65
+ -moz-border-radius: 12px;
66
+ border-radius: 12px;
67
+ -moz-box-shadow: 1px 1px 3px #000;
68
+ -webkit-box-shadow: 1px 1px 3px #000;
69
+ box-shadow: 1px 1px 3px #000;
70
+ opacity: 1 !important;
71
+ }
72
+
73
+ .close:hover { background: #00d9ff; }
files/third-party/tooltipster/css/tooltipster.css ADDED
@@ -0,0 +1,274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* This is the default Tooltipster theme (feel free to modify or duplicate and create multiple themes!): */
2
+ .tooltipster-default {
3
+ border-radius: 5px;
4
+ border: 2px solid #000;
5
+ background: #4c4c4c;
6
+ color: #fff;
7
+ }
8
+
9
+ /* Use this next selector to style things like font-size and line-height: */
10
+ .tooltipster-default .tooltipster-content {
11
+ font-family: Arial, sans-serif;
12
+ font-size: 14px;
13
+ line-height: 16px;
14
+ padding: 8px 10px;
15
+ overflow: hidden;
16
+ }
17
+
18
+ /* This next selector defines the color of the border on the outside of the arrow. This will automatically match the color and size of the border set on the main tooltip styles. Set display: none; if you would like a border around the tooltip but no border around the arrow */
19
+ .tooltipster-default .tooltipster-arrow .tooltipster-arrow-border {
20
+ /* border-color: ... !important; */
21
+ }
22
+
23
+
24
+ /* If you're using the icon option, use this next selector to style them */
25
+ .tooltipster-icon {
26
+ cursor: help;
27
+ margin-left: 4px;
28
+ }
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+ /* This is the base styling required to make all Tooltipsters work */
38
+ .tooltipster-base {
39
+ padding: 0;
40
+ font-size: 0;
41
+ line-height: 0;
42
+ position: absolute;
43
+ left: 0;
44
+ top: 0;
45
+ z-index: 9999999;
46
+ pointer-events: none;
47
+ width: auto;
48
+ overflow: visible;
49
+ }
50
+ .tooltipster-base .tooltipster-content {
51
+ overflow: hidden;
52
+ }
53
+
54
+
55
+ /* These next classes handle the styles for the little arrow attached to the tooltip. By default, the arrow will inherit the same colors and border as what is set on the main tooltip itself. */
56
+ .tooltipster-arrow {
57
+ display: block;
58
+ text-align: center;
59
+ width: 100%;
60
+ height: 100%;
61
+ position: absolute;
62
+ top: 0;
63
+ left: 0;
64
+ z-index: -1;
65
+ }
66
+ .tooltipster-arrow span, .tooltipster-arrow-border {
67
+ display: block;
68
+ width: 0;
69
+ height: 0;
70
+ position: absolute;
71
+ }
72
+ .tooltipster-arrow-top span, .tooltipster-arrow-top-right span, .tooltipster-arrow-top-left span {
73
+ border-left: 8px solid transparent !important;
74
+ border-right: 8px solid transparent !important;
75
+ border-top: 8px solid;
76
+ bottom: -7px;
77
+ }
78
+ .tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-top-left .tooltipster-arrow-border {
79
+ border-left: 9px solid transparent !important;
80
+ border-right: 9px solid transparent !important;
81
+ border-top: 9px solid;
82
+ bottom: -7px;
83
+ }
84
+
85
+ .tooltipster-arrow-bottom span, .tooltipster-arrow-bottom-right span, .tooltipster-arrow-bottom-left span {
86
+ border-left: 8px solid transparent !important;
87
+ border-right: 8px solid transparent !important;
88
+ border-bottom: 8px solid;
89
+ top: -7px;
90
+ }
91
+ .tooltipster-arrow-bottom .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border {
92
+ border-left: 9px solid transparent !important;
93
+ border-right: 9px solid transparent !important;
94
+ border-bottom: 9px solid;
95
+ top: -7px;
96
+ }
97
+ .tooltipster-arrow-top span, .tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-bottom span, .tooltipster-arrow-bottom .tooltipster-arrow-border {
98
+ left: 0;
99
+ right: 0;
100
+ margin: 0 auto;
101
+ }
102
+ .tooltipster-arrow-top-left span, .tooltipster-arrow-bottom-left span {
103
+ left: 6px;
104
+ }
105
+ .tooltipster-arrow-top-left .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border {
106
+ left: 5px;
107
+ }
108
+ .tooltipster-arrow-top-right span, .tooltipster-arrow-bottom-right span {
109
+ right: 6px;
110
+ }
111
+ .tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border {
112
+ right: 5px;
113
+ }
114
+ .tooltipster-arrow-left span, .tooltipster-arrow-left .tooltipster-arrow-border {
115
+ border-top: 8px solid transparent !important;
116
+ border-bottom: 8px solid transparent !important;
117
+ border-left: 8px solid;
118
+ top: 50%;
119
+ margin-top: -7px;
120
+ right: -7px;
121
+ }
122
+ .tooltipster-arrow-left .tooltipster-arrow-border {
123
+ border-top: 9px solid transparent !important;
124
+ border-bottom: 9px solid transparent !important;
125
+ border-left: 9px solid;
126
+ margin-top: -8px;
127
+ }
128
+ .tooltipster-arrow-right span, .tooltipster-arrow-right .tooltipster-arrow-border {
129
+ border-top: 8px solid transparent !important;
130
+ border-bottom: 8px solid transparent !important;
131
+ border-right: 8px solid;
132
+ top: 50%;
133
+ margin-top: -7px;
134
+ left: -7px;
135
+ }
136
+ .tooltipster-arrow-right .tooltipster-arrow-border {
137
+ border-top: 9px solid transparent !important;
138
+ border-bottom: 9px solid transparent !important;
139
+ border-right: 9px solid;
140
+ margin-top: -8px;
141
+ }
142
+
143
+
144
+ /* Some CSS magic for the awesome animations - feel free to make your own custom animations and reference it in your Tooltipster settings! */
145
+
146
+ .tooltipster-fade {
147
+ opacity: 0;
148
+ -webkit-transition-property: opacity;
149
+ -moz-transition-property: opacity;
150
+ -o-transition-property: opacity;
151
+ -ms-transition-property: opacity;
152
+ transition-property: opacity;
153
+ }
154
+ .tooltipster-fade-show {
155
+ opacity: 1;
156
+ }
157
+
158
+ .tooltipster-grow {
159
+ -webkit-transform: scale(0,0);
160
+ -moz-transform: scale(0,0);
161
+ -o-transform: scale(0,0);
162
+ -ms-transform: scale(0,0);
163
+ transform: scale(0,0);
164
+ -webkit-transition-property: -webkit-transform;
165
+ -moz-transition-property: -moz-transform;
166
+ -o-transition-property: -o-transform;
167
+ -ms-transition-property: -ms-transform;
168
+ transition-property: transform;
169
+ -webkit-backface-visibility: hidden;
170
+ }
171
+ .tooltipster-grow-show {
172
+ -webkit-transform: scale(1,1);
173
+ -moz-transform: scale(1,1);
174
+ -o-transform: scale(1,1);
175
+ -ms-transform: scale(1,1);
176
+ transform: scale(1,1);
177
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
178
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
179
+ -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
180
+ -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
181
+ -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
182
+ transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
183
+ }
184
+
185
+ .tooltipster-swing {
186
+ opacity: 0;
187
+ -webkit-transform: rotateZ(4deg);
188
+ -moz-transform: rotateZ(4deg);
189
+ -o-transform: rotateZ(4deg);
190
+ -ms-transform: rotateZ(4deg);
191
+ transform: rotateZ(4deg);
192
+ -webkit-transition-property: -webkit-transform, opacity;
193
+ -moz-transition-property: -moz-transform;
194
+ -o-transition-property: -o-transform;
195
+ -ms-transition-property: -ms-transform;
196
+ transition-property: transform;
197
+ }
198
+ .tooltipster-swing-show {
199
+ opacity: 1;
200
+ -webkit-transform: rotateZ(0deg);
201
+ -moz-transform: rotateZ(0deg);
202
+ -o-transform: rotateZ(0deg);
203
+ -ms-transform: rotateZ(0deg);
204
+ transform: rotateZ(0deg);
205
+ -webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 1);
206
+ -webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
207
+ -moz-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
208
+ -ms-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
209
+ -o-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
210
+ transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4);
211
+ }
212
+
213
+ .tooltipster-fall {
214
+ top: 0;
215
+ -webkit-transition-property: top;
216
+ -moz-transition-property: top;
217
+ -o-transition-property: top;
218
+ -ms-transition-property: top;
219
+ transition-property: top;
220
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
221
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
222
+ -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
223
+ -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
224
+ -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
225
+ transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
226
+ }
227
+ .tooltipster-fall-show {
228
+ }
229
+ .tooltipster-fall.tooltipster-dying {
230
+ -webkit-transition-property: all;
231
+ -moz-transition-property: all;
232
+ -o-transition-property: all;
233
+ -ms-transition-property: all;
234
+ transition-property: all;
235
+ top: 0px !important;
236
+ opacity: 0;
237
+ }
238
+
239
+ .tooltipster-slide {
240
+ left: -40px;
241
+ -webkit-transition-property: left;
242
+ -moz-transition-property: left;
243
+ -o-transition-property: left;
244
+ -ms-transition-property: left;
245
+ transition-property: left;
246
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1);
247
+ -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
248
+ -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
249
+ -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
250
+ -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
251
+ transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15);
252
+ }
253
+ .tooltipster-slide.tooltipster-slide-show {
254
+ }
255
+ .tooltipster-slide.tooltipster-dying {
256
+ -webkit-transition-property: all;
257
+ -moz-transition-property: all;
258
+ -o-transition-property: all;
259
+ -ms-transition-property: all;
260
+ transition-property: all;
261
+ left: 0px !important;
262
+ opacity: 0;
263
+ }
264
+
265
+
266
+ /* CSS transition for when contenting is changing in a tooltip that is still open. The only properties that will NOT transition are: width, height, top, and left */
267
+ .tooltipster-content-changing {
268
+ opacity: 0.5;
269
+ -webkit-transform: scale(1.1, 1.1);
270
+ -moz-transform: scale(1.1, 1.1);
271
+ -o-transform: scale(1.1, 1.1);
272
+ -ms-transform: scale(1.1, 1.1);
273
+ transform: scale(1.1, 1.1);
274
+ }
files/third-party/tooltipster/js/html5.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /*
2
+ HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
3
+ */
4
+ (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
5
+ a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}</style>";
6
+ c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
7
+ "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);
8
+ if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);
files/third-party/tooltipster/js/jquery.tooltipster.min.js ADDED
@@ -0,0 +1 @@
 
1
+ /* Tooltipster v3.2.6 */;(function(e,t,n){function s(t,n){this.bodyOverflowX;this.callbacks={hide:[],show:[]};this.checkInterval=null;this.Content;this.$el=e(t);this.$elProxy;this.elProxyPosition;this.enabled=true;this.options=e.extend({},i,n);this.mouseIsOverProxy=false;this.namespace="tooltipster-"+Math.round(Math.random()*1e5);this.Status="hidden";this.timerHide=null;this.timerShow=null;this.$tooltip;this.options.iconTheme=this.options.iconTheme.replace(".","");this.options.theme=this.options.theme.replace(".","");this._init()}function o(t,n){var r=true;e.each(t,function(e,i){if(typeof n[e]==="undefined"||t[e]!==n[e]){r=false;return false}});return r}function f(){return!a&&u}function l(){var e=n.body||n.documentElement,t=e.style,r="transition";if(typeof t[r]=="string"){return true}v=["Moz","Webkit","Khtml","O","ms"],r=r.charAt(0).toUpperCase()+r.substr(1);for(var i=0;i<v.length;i++){if(typeof t[v[i]+r]=="string"){return true}}return false}var r="tooltipster",i={animation:"fade",arrow:true,arrowColor:"",autoClose:true,content:null,contentAsHTML:false,contentCloning:true,debug:true,delay:200,minWidth:0,maxWidth:null,functionInit:function(e,t){},functionBefore:function(e,t){t()},functionReady:function(e,t){},functionAfter:function(e){},icon:"(?)",iconCloning:true,iconDesktop:false,iconTouch:false,iconTheme:"tooltipster-icon",interactive:false,interactiveTolerance:350,multiple:false,offsetX:0,offsetY:0,onlyOne:false,position:"top",positionTracker:false,speed:350,timer:0,theme:"tooltipster-default",touchDevices:true,trigger:"hover",updateAnimation:true};s.prototype={_init:function(){var t=this;if(n.querySelector){if(t.options.content!==null){t._content_set(t.options.content)}else{var r=t.$el.attr("title");if(typeof r==="undefined")r=null;t._content_set(r)}var i=t.options.functionInit.call(t.$el,t.$el,t.Content);if(typeof i!=="undefined")t._content_set(i);t.$el.removeAttr("title").addClass("tooltipstered");if(!u&&t.options.iconDesktop||u&&t.options.iconTouch){if(typeof t.options.icon==="string"){t.$elProxy=e('<span class="'+t.options.iconTheme+'"></span>');t.$elProxy.text(t.options.icon)}else{if(t.options.iconCloning)t.$elProxy=t.options.icon.clone(true);else t.$elProxy=t.options.icon}t.$elProxy.insertAfter(t.$el)}else{t.$elProxy=t.$el}if(t.options.trigger=="hover"){t.$elProxy.on("mouseenter."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=true;t._show()}}).on("mouseleave."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=false}});if(u&&t.options.touchDevices){t.$elProxy.on("touchstart."+t.namespace,function(){t._showNow()})}}else if(t.options.trigger=="click"){t.$elProxy.on("click."+t.namespace,function(){if(!f()||t.options.touchDevices){t._show()}})}}},_show:function(){var e=this;if(e.Status!="shown"&&e.Status!="appearing"){if(e.options.delay){e.timerShow=setTimeout(function(){if(e.options.trigger=="click"||e.options.trigger=="hover"&&e.mouseIsOverProxy){e._showNow()}},e.options.delay)}else e._showNow()}},_showNow:function(n){var r=this;r.options.functionBefore.call(r.$el,r.$el,function(){if(r.enabled&&r.Content!==null){if(n)r.callbacks.show.push(n);r.callbacks.hide=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;if(r.options.onlyOne){e(".tooltipstered").not(r.$el).each(function(t,n){var r=e(n),i=r.data("tooltipster-ns");e.each(i,function(e,t){var n=r.data(t),i=n.status(),s=n.option("autoClose");if(i!=="hidden"&&i!=="disappearing"&&s){n.hide()}})})}var i=function(){r.Status="shown";e.each(r.callbacks.show,function(e,t){t.call(r.$el)});r.callbacks.show=[]};if(r.Status!=="hidden"){var s=0;if(r.Status==="disappearing"){r.Status="appearing";if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-"+r.options.animation+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.stop().fadeIn(i)}}else if(r.Status==="shown"){i()}}else{r.Status="appearing";var s=r.options.speed;r.bodyOverflowX=e("body").css("overflow-x");e("body").css("overflow-x","hidden");var o="tooltipster-"+r.options.animation,a="-webkit-transition-duration: "+r.options.speed+"ms; -webkit-animation-duration: "+r.options.speed+"ms; -moz-transition-duration: "+r.options.speed+"ms; -moz-animation-duration: "+r.options.speed+"ms; -o-transition-duration: "+r.options.speed+"ms; -o-animation-duration: "+r.options.speed+"ms; -ms-transition-duration: "+r.options.speed+"ms; -ms-animation-duration: "+r.options.speed+"ms; transition-duration: "+r.options.speed+"ms; animation-duration: "+r.options.speed+"ms;",f=r.options.minWidth?"min-width:"+Math.round(r.options.minWidth)+"px;":"",c=r.options.maxWidth?"max-width:"+Math.round(r.options.maxWidth)+"px;":"",h=r.options.interactive?"pointer-events: auto;":"";r.$tooltip=e('<div class="tooltipster-base '+r.options.theme+'" style="'+f+" "+c+" "+h+" "+a+'"><div class="tooltipster-content"></div></div>');if(l())r.$tooltip.addClass(o);r._content_insert();r.$tooltip.appendTo("body");r.reposition();r.options.functionReady.call(r.$el,r.$el,r.$tooltip);if(l()){r.$tooltip.addClass(o+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.css("display","none").fadeIn(r.options.speed,i)}r._interval_set();e(t).on("scroll."+r.namespace+" resize."+r.namespace,function(){r.reposition()});if(r.options.autoClose){e("body").off("."+r.namespace);if(r.options.trigger=="hover"){if(u){setTimeout(function(){e("body").on("touchstart."+r.namespace,function(){r.hide()})},0)}if(r.options.interactive){if(u){r.$tooltip.on("touchstart."+r.namespace,function(e){e.stopPropagation()})}var p=null;r.$elProxy.add(r.$tooltip).on("mouseleave."+r.namespace+"-autoClose",function(){clearTimeout(p);p=setTimeout(function(){r.hide()},r.options.interactiveTolerance)}).on("mouseenter."+r.namespace+"-autoClose",function(){clearTimeout(p)})}else{r.$elProxy.on("mouseleave."+r.namespace+"-autoClose",function(){r.hide()})}}else if(r.options.trigger=="click"){setTimeout(function(){e("body").on("click."+r.namespace+" touchstart."+r.namespace,function(){r.hide()})},0);if(r.options.interactive){r.$tooltip.on("click."+r.namespace+" touchstart."+r.namespace,function(e){e.stopPropagation()})}}}}if(r.options.timer>0){r.timerHide=setTimeout(function(){r.timerHide=null;r.hide()},r.options.timer+s)}}})},_interval_set:function(){var t=this;t.checkInterval=setInterval(function(){if(e("body").find(t.$el).length===0||e("body").find(t.$elProxy).length===0||t.Status=="hidden"||e("body").find(t.$tooltip).length===0){if(t.Status=="shown"||t.Status=="appearing")t.hide();t._interval_cancel()}else{if(t.options.positionTracker){var n=t._repositionInfo(t.$elProxy),r=false;if(o(n.dimension,t.elProxyPosition.dimension)){if(t.$elProxy.css("position")==="fixed"){if(o(n.position,t.elProxyPosition.position))r=true}else{if(o(n.offset,t.elProxyPosition.offset))r=true}}if(!r){t.reposition()}}}},200)},_interval_cancel:function(){clearInterval(this.checkInterval);this.checkInterval=null},_content_set:function(e){if(typeof e==="object"&&e!==null&&this.options.contentCloning){e=e.clone(true)}this.Content=e},_content_insert:function(){var e=this,t=this.$tooltip.find(".tooltipster-content");if(typeof e.Content==="string"&&!e.options.contentAsHTML){t.text(e.Content)}else{t.empty().append(e.Content)}},_update:function(e){var t=this;t._content_set(e);if(t.Content!==null){if(t.Status!=="hidden"){t._content_insert();t.reposition();if(t.options.updateAnimation){if(l()){t.$tooltip.css({width:"","-webkit-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-moz-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-o-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-ms-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms",transition:"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms"}).addClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!="hidden"){t.$tooltip.removeClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!=="hidden"){t.$tooltip.css({"-webkit-transition":t.options.speed+"ms","-moz-transition":t.options.speed+"ms","-o-transition":t.options.speed+"ms","-ms-transition":t.options.speed+"ms",transition:t.options.speed+"ms"})}},t.options.speed)}},t.options.speed)}else{t.$tooltip.fadeTo(t.options.speed,.5,function(){if(t.Status!="hidden"){t.$tooltip.fadeTo(t.options.speed,1)}})}}}}else{t.hide()}},_repositionInfo:function(e){return{dimension:{height:e.outerHeight(false),width:e.outerWidth(false)},offset:e.offset(),position:{left:parseInt(e.css("left")),top:parseInt(e.css("top"))}}},hide:function(n){var r=this;if(n)r.callbacks.hide.push(n);r.callbacks.show=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;var i=function(){e.each(r.callbacks.hide,function(e,t){t.call(r.$el)});r.callbacks.hide=[]};if(r.Status=="shown"||r.Status=="appearing"){r.Status="disappearing";var s=function(){r.Status="hidden";if(typeof r.Content=="object"&&r.Content!==null){r.Content.detach()}r.$tooltip.remove();r.$tooltip=null;e(t).off("."+r.namespace);e("body").off("."+r.namespace).css("overflow-x",r.bodyOverflowX);e("body").off("."+r.namespace);r.$elProxy.off("."+r.namespace+"-autoClose");r.options.functionAfter.call(r.$el,r.$el);i()};if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-"+r.options.animation+"-show").addClass("tooltipster-dying");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(s)}else{r.$tooltip.stop().fadeOut(r.options.speed,s)}}else if(r.Status=="hidden"){i()}return r},show:function(e){this._showNow(e);return this},update:function(e){return this.content(e)},content:function(e){if(typeof e==="undefined"){return this.Content}else{this._update(e);return this}},reposition:function(){var n=this;if(e("body").find(n.$tooltip).length!==0){n.$tooltip.css("width","");n.elProxyPosition=n._repositionInfo(n.$elProxy);var r=null,i=e(t).width(),s=n.elProxyPosition,o=n.$tooltip.outerWidth(false),u=n.$tooltip.innerWidth()+1,a=n.$tooltip.outerHeight(false);if(n.$elProxy.is("area")){var f=n.$elProxy.attr("shape"),l=n.$elProxy.parent().attr("name"),c=e('img[usemap="#'+l+'"]'),h=c.offset().left,p=c.offset().top,d=n.$elProxy.attr("coords")!==undefined?n.$elProxy.attr("coords").split(","):undefined;if(f=="circle"){var v=parseInt(d[0]),m=parseInt(d[1]),g=parseInt(d[2]);s.dimension.height=g*2;s.dimension.width=g*2;s.offset.top=p+m-g;s.offset.left=h+v-g}else if(f=="rect"){var v=parseInt(d[0]),m=parseInt(d[1]),y=parseInt(d[2]),b=parseInt(d[3]);s.dimension.height=b-m;s.dimension.width=y-v;s.offset.top=p+m;s.offset.left=h+v}else if(f=="poly"){var w=[],E=[],S=0,x=0,T=0,N=0,C="even";for(var k=0;k<d.length;k++){var L=parseInt(d[k]);if(C=="even"){if(L>T){T=L;if(k===0){S=T}}if(L<S){S=L}C="odd"}else{if(L>N){N=L;if(k==1){x=N}}if(L<x){x=L}C="even"}}s.dimension.height=N-x;s.dimension.width=T-S;s.offset.top=p+x;s.offset.left=h+S}else{s.dimension.height=c.outerHeight(false);s.dimension.width=c.outerWidth(false);s.offset.top=p;s.offset.left=h}}var A=0,O=0,M=0,_=parseInt(n.options.offsetY),D=parseInt(n.options.offsetX),P=n.options.position;function H(){var n=e(t).scrollLeft();if(A-n<0){r=A-n;A=n}if(A+o-n>i){r=A-(i+n-o);A=i+n-o}}function B(n,r){if(s.offset.top-e(t).scrollTop()-a-_-12<0&&r.indexOf("top")>-1){P=n}if(s.offset.top+s.dimension.height+a+12+_>e(t).scrollTop()+e(t).height()&&r.indexOf("bottom")>-1){P=n;M=s.offset.top-a-_-12}}if(P=="top"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left+D-j/2;M=s.offset.top-a-_-12;H();B("bottom","top")}if(P=="top-left"){A=s.offset.left+D;M=s.offset.top-a-_-12;H();B("bottom-left","top-left")}if(P=="top-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top-a-_-12;H();B("bottom-right","top-right")}if(P=="bottom"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left-j/2+D;M=s.offset.top+s.dimension.height+_+12;H();B("top","bottom")}if(P=="bottom-left"){A=s.offset.left+D;M=s.offset.top+s.dimension.height+_+12;H();B("top-left","bottom-left")}if(P=="bottom-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top+s.dimension.height+_+12;H();B("top-right","bottom-right")}if(P=="left"){A=s.offset.left-D-o-12;O=s.offset.left+D+s.dimension.width+12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A<0&&O+o>i){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=o+A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);A=s.offset.left-D-q-12-I;F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A<0){A=s.offset.left+D+s.dimension.width+12;r="left"}}if(P=="right"){A=s.offset.left+D+s.dimension.width+12;O=s.offset.left-D-o-12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A+o>i&&O<0){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=i-A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A+o>i){A=s.offset.left-D-o-12;r="right"}}if(n.options.arrow){var R="tooltipster-arrow-"+P;if(n.options.arrowColor.length<1){var U=n.$tooltip.css("background-color")}else{var U=n.options.arrowColor}if(!r){r=""}else if(r=="left"){R="tooltipster-arrow-right";r=""}else if(r=="right"){R="tooltipster-arrow-left";r=""}else{r="left:"+Math.round(r)+"px;"}if(P=="top"||P=="top-left"||P=="top-right"){var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}else if(P=="bottom"||P=="bottom-left"||P=="bottom-right"){var z=parseFloat(n.$tooltip.css("border-top-width")),W=n.$tooltip.css("border-top-color")}else if(P=="left"){var z=parseFloat(n.$tooltip.css("border-right-width")),W=n.$tooltip.css("border-right-color")}else if(P=="right"){var z=parseFloat(n.$tooltip.css("border-left-width")),W=n.$tooltip.css("border-left-color")}else{var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}if(z>1){z++}var X="";if(z!==0){var V="",J="border-color: "+W+";";if(R.indexOf("bottom")!==-1){V="margin-top: -"+Math.round(z)+"px;"}else if(R.indexOf("top")!==-1){V="margin-bottom: -"+Math.round(z)+"px;"}else if(R.indexOf("left")!==-1){V="margin-right: -"+Math.round(z)+"px;"}else if(R.indexOf("right")!==-1){V="margin-left: -"+Math.round(z)+"px;"}X='<span class="tooltipster-arrow-border" style="'+V+" "+J+';"></span>'}n.$tooltip.find(".tooltipster-arrow").remove();var K='<div class="'+R+' tooltipster-arrow" style="'+r+'">'+X+'<span style="border-color:'+U+';"></span></div>';n.$tooltip.append(K)}n.$tooltip.css({top:Math.round(M)+"px",left:Math.round(A)+"px"})}return n},enable:function(){this.enabled=true;return this},disable:function(){this.hide();this.enabled=false;return this},destroy:function(){var t=this;t.hide();if(t.$el[0]!==t.$elProxy[0])t.$elProxy.remove();t.$el.removeData(t.namespace).off("."+t.namespace);var n=t.$el.data("tooltipster-ns");if(n.length===1){var r=typeof t.Content==="string"?t.Content:e("<div></div>").append(t.Content).html();t.$el.removeClass("tooltipstered").attr("title",r).removeData(t.namespace).removeData("tooltipster-ns").off("."+t.namespace)}else{n=e.grep(n,function(e,n){return e!==t.namespace});t.$el.data("tooltipster-ns",n)}return t},elementIcon:function(){return this.$el[0]!==this.$elProxy[0]?this.$elProxy[0]:undefined},elementTooltip:function(){return this.$tooltip?this.$tooltip[0]:undefined},option:function(e,t){if(typeof t=="undefined")return this.options[e];else{this.options[e]=t;return this}},status:function(){return this.Status}};e.fn[r]=function(){var t=arguments;if(this.length===0){if(typeof t[0]==="string"){var n=true;switch(t[0]){case"setDefaults":e.extend(i,t[1]);break;default:n=false;break}if(n)return true;else return this}else{return this}}else{if(typeof t[0]==="string"){var r="#*$~&";this.each(function(){var n=e(this).data("tooltipster-ns"),i=n?e(this).data(n[0]):null;if(i){if(typeof i[t[0]]==="function"){var s=i[t[0]](t[1],t[2])}else{throw new Error('Unknown method .tooltipster("'+t[0]+'")')}if(s!==i){r=s;return false}}else{throw new Error("You called Tooltipster's \""+t[0]+'" method on an uninitialized element')}});return r!=="#*$~&"?r:this}else{var o=[],u=t[0]&&typeof t[0].multiple!=="undefined",a=u&&t[0].multiple||!u&&i.multiple,f=t[0]&&typeof t[0].debug!=="undefined",l=f&&t[0].debug||!f&&i.debug;this.each(function(){var n=false,r=e(this).data("tooltipster-ns"),i=null;if(!r){n=true}else if(a){n=true}else if(l){console.log('Tooltipster: one or more tooltips are already attached to this element: ignoring. Use the "multiple" option to attach more tooltips.')}if(n){i=new s(this,t[0]);if(!r)r=[];r.push(i.namespace);e(this).data("tooltipster-ns",r);e(this).data(i.namespace,i)}o.push(i)});if(a)return o;else return this}}};var u=!!("ontouchstart"in t);var a=false;e("body").one("mousemove",function(){a=true})})(jQuery,window,document);
helper/wc-helper.php ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WC_Helper {
4
+
5
+ public static $datetime = 'datetime';
6
+ public static $datetime_phrases_keys = array(
7
+ 'wc_year_text', 'wc_month_text', 'wc_day_text',
8
+ 'wc_hour_text', 'wc_minute_text', 'wc_second_text'
9
+ );
10
+ public static $year = 'wc_year_text';
11
+ public static $month = 'wc_month_text';
12
+ public static $day = 'wc_day_text';
13
+ public static $hour = 'wc_hour_text';
14
+ public static $minute = 'wc_minute_text';
15
+ public static $second = 'wc_second_text';
16
+ private $wc_options_serialize;
17
+
18
+ function __construct($wc_options_serialize) {
19
+ $this->wc_options_serialize = $wc_options_serialize;
20
+ }
21
+
22
+ // Set timezone
23
+ // Time format is UNIX timestamp or
24
+ // PHP strtotime compatible strings
25
+ public function dateDiff($time1, $time2, $precision = 2) {
26
+ // If not numeric then convert texts to unix timestamps
27
+ if (!is_int($time1)) {
28
+ $time1 = strtotime($time1);
29
+ }
30
+ if (!is_int($time2)) {
31
+ $time2 = strtotime($time2);
32
+ }
33
+
34
+ // If time1 is bigger than time2
35
+ // Then swap time1 and time2
36
+ if ($time1 > $time2) {
37
+ $ttime = $time1;
38
+ $time1 = $time2;
39
+ $time2 = $ttime;
40
+ }
41
+
42
+ // Set up intervals and diffs arrays
43
+ $intervals = array(
44
+ $this->wc_options_serialize->wc_phrases['wc_year_text']['datetime'][1],
45
+ $this->wc_options_serialize->wc_phrases['wc_month_text']['datetime'][1],
46
+ $this->wc_options_serialize->wc_phrases['wc_day_text']['datetime'][1],
47
+ $this->wc_options_serialize->wc_phrases['wc_hour_text']['datetime'][1],
48
+ $this->wc_options_serialize->wc_phrases['wc_minute_text']['datetime'][1],
49
+ $this->wc_options_serialize->wc_phrases['wc_second_text']['datetime'][1]
50
+ );
51
+ $diffs = array();
52
+
53
+ // Loop thru all intervals
54
+ foreach ($intervals as $interval) {
55
+ // Create temp time from time1 and interval
56
+ $interval = $this->date_comparision_by_index($interval);
57
+ $ttime = strtotime('+1 ' . $interval, $time1);
58
+ // Set initial values
59
+ $add = 1;
60
+ $looped = 0;
61
+ // Loop until temp time is smaller than time2
62
+ while ($time2 >= $ttime) {
63
+ // Create new temp time from time1 and interval
64
+ $add++;
65
+ $ttime = strtotime("+" . $add . " " . $interval, $time1);
66
+ $looped++;
67
+ }
68
+
69
+ $time1 = strtotime("+" . $looped . " " . $interval, $time1);
70
+ $diffs[$interval] = $looped;
71
+ }
72
+
73
+ $count = 0;
74
+ $times = array();
75
+ // Loop thru all diffs
76
+ foreach ($diffs as $interval => $value) {
77
+ $interval = $this->date_text_by_index($interval);
78
+ // Break if we have needed precission
79
+ if ($count >= $precision) {
80
+ break;
81
+ }
82
+ // Add value and interval
83
+ // if value is bigger than 0
84
+ if ($value > 0) {
85
+ // Add s if value is not 1
86
+ if ($value != 1) {
87
+ $interval .= $this->wc_options_serialize->wc_phrases['wc_plural_text'];
88
+ }
89
+ // Add value and interval to times array
90
+ $times[] = $value . " " . $interval;
91
+ $count++;
92
+ }
93
+ }
94
+
95
+ // Return string with times
96
+ $ago = ($times) ? $this->wc_options_serialize->wc_phrases['wc_ago_text'] : $this->wc_options_serialize->wc_phrases['wc_right_now_text'];
97
+ return implode(" ", $times) . ' ' . $ago;
98
+ }
99
+
100
+ /**
101
+ * get comment author avatar if exists otherwise default avatar
102
+ */
103
+ public function get_comment_author_avatar($comment = null) {
104
+ global $current_user;
105
+ get_currentuserinfo();
106
+
107
+ $comm_auth_user_email = $current_user->user_email;
108
+ if ($comment) {
109
+ $comm_auth_avatar = get_avatar($comment->comment_author_email, 48);
110
+ } else {
111
+ if ($comm_auth_user_email) {
112
+ $comm_auth_avatar = get_avatar($comm_auth_user_email, 48);
113
+ } else {
114
+ $comm_auth_avatar = '<img width="48" height="48" class="avatar avatar-48 photo avatar-default" src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/avatar_default.png') . '" alt=""/>';
115
+ }
116
+ }
117
+ return $comm_auth_avatar;
118
+ }
119
+
120
+ public static function init_phrase_key_value($phrase) {
121
+ $phrase_value = stripslashes($phrase['phrase_value']);
122
+ switch ($phrase['phrase_key']) {
123
+ case WC_Helper::$year:
124
+ return array(WC_Helper::$datetime => array($phrase_value, 1));
125
+ case WC_Helper::$month:
126
+ return array(WC_Helper::$datetime => array($phrase_value, 2));
127
+ case WC_Helper::$day:
128
+ return array(WC_Helper::$datetime => array($phrase_value, 3));
129
+ case WC_Helper::$hour:
130
+ return array(WC_Helper::$datetime => array($phrase_value, 4));
131
+ case WC_Helper::$minute:
132
+ return array(WC_Helper::$datetime => array($phrase_value, 5));
133
+ case WC_Helper::$second:
134
+ return array(WC_Helper::$datetime => array($phrase_value, 6));
135
+ default :
136
+ return $phrase_value;
137
+ }
138
+ }
139
+
140
+ private function date_comparision_by_index($index) {
141
+ switch ($index) {
142
+ case 1:
143
+ return 'year';
144
+ case 2:
145
+ return 'month';
146
+ case 3:
147
+ return 'day';
148
+ case 4:
149
+ return 'hour';
150
+ case 5:
151
+ return 'minute';
152
+ case 6:
153
+ return 'second';
154
+ }
155
+ }
156
+
157
+ private function date_text_by_index($index) {
158
+ switch ($index) {
159
+ case 'year':
160
+ return $this->wc_options_serialize->wc_phrases['wc_year_text']['datetime'][0];
161
+ case 'month':
162
+ return $this->wc_options_serialize->wc_phrases['wc_month_text']['datetime'][0];
163
+ case 'day':
164
+ return $this->wc_options_serialize->wc_phrases['wc_day_text']['datetime'][0];
165
+ case 'hour':
166
+ return $this->wc_options_serialize->wc_phrases['wc_hour_text']['datetime'][0];
167
+ case 'minute':
168
+ return $this->wc_options_serialize->wc_phrases['wc_minute_text']['datetime'][0];
169
+ case 'second':
170
+ return $this->wc_options_serialize->wc_phrases['wc_second_text']['datetime'][0];
171
+ }
172
+ }
173
+
174
+ }
includes/wc-db-helper.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
4
+
5
+ class WC_DB_Helper {
6
+
7
+ private $db;
8
+ private $dbprefix;
9
+ private $users_voted;
10
+ private $phrases;
11
+
12
+ function __construct() {
13
+ global $wpdb;
14
+ $this->db = $wpdb;
15
+ $this->dbprefix = $wpdb->prefix;
16
+ $this->users_voted = $this->dbprefix . 'wc_users_voted';
17
+ $this->phrases = $this->dbprefix . 'wc_phrases';
18
+ }
19
+
20
+ /**
21
+ * create table in db on activation if not exists
22
+ */
23
+ public function create_tables() {
24
+ if ($this->db->get_var("SHOW TABLES LIKE '$this->users_voted'") != $this->users_voted) {
25
+ $sql = "CREATE TABLE `" . $this->users_voted . "`(`id` INT(11) NOT NULL AUTO_INCREMENT,`user_id` INT(11) NOT NULL, `comment_id` INT(11) NOT NULL, `vote_type` INT(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_id` (`user_id`), KEY `comment_id` (`comment_id`), KEY `vote_type` (`vote_type`)) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci AUTO_INCREMENT=1;";
26
+ dbDelta($sql);
27
+ }
28
+ if ($this->db->get_var("SHOW TABLES LIKE '$this->phrases'") != $this->phrases) {
29
+ $sql = "CREATE TABLE `" . $this->phrases . "`(`id` INT(11) NOT NULL AUTO_INCREMENT, `phrase_key` VARCHAR(255) NOT NULL, `phrase_value` VARCHAR(255) NOT NULL, PRIMARY KEY (`id`), KEY `phrase_key` (`phrase_key`) );";
30
+ dbDelta($sql);
31
+ }
32
+ }
33
+
34
+
35
+ /**
36
+ * add vote type
37
+ */
38
+ public function add_vote_type($user_id, $comment_id, $vote_type) {
39
+ $sql = $this->db->prepare("INSERT INTO `" . $this->users_voted . "`(`user_id`, `comment_id`, `vote_type`)VALUES(%d,%d,%d);", $user_id, $comment_id, $vote_type);
40
+ return $this->db->query($sql);
41
+ }
42
+
43
+ /**
44
+ * update vote type
45
+ */
46
+ public function update_vote_type($user_id, $comment_id, $vote_type) {
47
+ $sql = $this->db->prepare("UPDATE `" . $this->users_voted . "` SET `vote_type` = %d WHERE `user_id` = %d AND `comment_id` = %d", $vote_type, $user_id, $comment_id);
48
+ return $this->db->query($sql);
49
+ }
50
+
51
+ /**
52
+ * check if the user is already voted on comment or not by user id and comment id
53
+ */
54
+ public function is_user_voted($user_id, $comment_id) {
55
+ $sql = $this->db->prepare("SELECT `vote_type` FROM `" . $this->users_voted . "` WHERE `user_id` = %d AND `comment_id` = %d;", $user_id, $comment_id);
56
+ return $this->db->get_var($sql);
57
+ }
58
+
59
+ /**
60
+ * update phrases
61
+ */
62
+ public function update_phrases($phrases) {
63
+ if ($phrases) {
64
+ foreach ($phrases as $phrase_key => $phrase_value) {
65
+
66
+ if (is_array($phrase_value) && array_key_exists(WC_Helper::$datetime, $phrase_value)) {
67
+ $phrase_value = $phrase_value[WC_Helper::$datetime][0];
68
+ }
69
+ if ($this->is_phrase_exists($phrase_key)) {
70
+ $sql = $this->db->prepare("UPDATE `" . $this->phrases . "` SET `phrase_value` = %s WHERE `phrase_key` = %s;", $phrase_value, $phrase_key);
71
+ } else {
72
+ $sql = $this->db->prepare("INSERT INTO `" . $this->phrases . "`(`phrase_key`, `phrase_value`)VALUES(%s, %s);", $phrase_key, $phrase_value);
73
+ }
74
+ $this->db->query($sql);
75
+ }
76
+ }
77
+ }
78
+
79
+ public function is_phrase_exists($phrase_key) {
80
+ $sql = $this->db->prepare("SELECT `phrase_value` FROM `" . $this->phrases . "` WHERE `phrase_key` LIKE %s", $phrase_key);
81
+ return $this->db->get_var($sql);
82
+ }
83
+
84
+ /**
85
+ * get phrases from db
86
+ */
87
+ public function get_phrases() {
88
+ $sql = "SELECT `phrase_key`, `phrase_value` FROM `" . $this->phrases . "`;";
89
+ $phrases = $this->db->get_results($sql, ARRAY_A);
90
+ $tmp_phrases = array();
91
+ foreach ($phrases as $phrase) {
92
+ $tmp_phrases[$phrase['phrase_key']] = WC_Helper::init_phrase_key_value($phrase);
93
+ }
94
+ return $tmp_phrases;
95
+ }
96
+
97
+ }
98
+
99
+ ?>
options-templates/options-template-main.php ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <th colspan="3" scope="col" style="margin-bottom: 5px;"><h2><?php _e('General settings', 'wpdiscuz'); ?></h2></th>
2
+
3
+ <tr valign="top">
4
+ <th scope="row">
5
+ <?php _e('Display comment form for post types:', 'wpdiscuz'); ?>
6
+ </th>
7
+ <td colspan="3">
8
+ <?php
9
+ foreach ($this->wc_post_types as $post_type) {
10
+ if (!post_type_supports($post_type, 'comments')) {
11
+ continue;
12
+ }
13
+ ?>
14
+ <label for="<?php echo $post_type ?>">
15
+ <input type="checkbox" <?php checked(in_array($post_type, $this->wc_options_serialize->wc_post_types)); ?> value="<?php echo $post_type; ?>" name="wc_post_types[]" id="wc_type_<?php echo $post_type; ?>" />
16
+ <span><?php echo $post_type; ?></span>
17
+ </label><br/>
18
+ <?php
19
+ }
20
+ ?>
21
+ </td>
22
+ </tr>
23
+
24
+
25
+ <tr valign="top">
26
+ <th scope="row">
27
+ <?php _e('Hide Voting buttons', 'wpdiscuz'); ?>
28
+ </th>
29
+ <td colspan="3">
30
+ <label for="wc_voting_buttons_show_hide">
31
+ <input type="checkbox" <?php checked($this->wc_options_serialize->wc_voting_buttons_show_hide == 1) ?> value="<?php echo $this->wc_options_serialize->wc_voting_buttons_show_hide; ?>" name="wc_voting_buttons_show_hide" id="wc_voting_buttons_show_hide" />
32
+ </label>
33
+ </td>
34
+ </tr>
35
+
36
+ <tr valign="top">
37
+ <th scope="row">
38
+ <?php _e('Hide Share Button', 'wpdiscuz'); ?>
39
+ </th>
40
+ <td colspan="3">
41
+ <label for="wc_share_buttons_show_hide">
42
+ <input type="checkbox" <?php checked($this->wc_options_serialize->wc_share_buttons_show_hide == 1) ?> value="<?php echo $this->wc_options_serialize->wc_share_buttons_show_hide; ?>" name="wc_share_buttons_show_hide" id="wc_share_buttons_show_hide" />
43
+ </label>
44
+ </td>
45
+ </tr>
46
+
47
+ <tr valign="top">
48
+ <th scope="row">
49
+ <?php _e('Hide the CAPTCHA field', 'wpdiscuz'); ?>
50
+ </th>
51
+ <td colspan="3">
52
+ <label for="wc_captcha_show_hide">
53
+ <input type="checkbox" <?php checked($this->wc_options_serialize->wc_captcha_show_hide == 1) ?> value="<?php echo $this->wc_options_serialize->wc_captcha_show_hide; ?>" name="wc_captcha_show_hide" id="wc_captcha_show_hide" />
54
+ </label>
55
+ </td>
56
+ </tr>
57
+
58
+ <tr valign="top">
59
+ <th scope="row">
60
+ <?php _e('User Must be registered to comment', 'wpdiscuz'); ?>
61
+ </th>
62
+ <td colspan="3">
63
+ <fieldset>
64
+ <label title="Yes">
65
+ <input type="radio" value="1" <?php checked('1' == $this->wc_options_serialize->wc_user_must_be_registered); ?> name="wc_user_must_be_registered" id="wc_user_must_be_registered_yes" />
66
+ <span>Yes</span>
67
+ </label> &nbsp;
68
+ <label title="No">
69
+ <input type="radio" value="0" <?php checked('0' == $this->wc_options_serialize->wc_user_must_be_registered); ?> name="wc_user_must_be_registered" id="wc_user_must_be_registered_no" />
70
+ <span>No</span>
71
+ </label><br>
72
+ </fieldset>
73
+ </td>
74
+ </tr>
75
+
76
+ <tr valign="top">
77
+ <th scope="row">
78
+ <?php _e('Held new comments for moderation', 'wpdiscuz'); ?>
79
+ </th>
80
+ <td colspan="3">
81
+ <label for="wc_held_comment_to_moderate">
82
+ <input type="checkbox" <?php checked($this->wc_options_serialize->wc_held_comment_to_moderate == 1) ?> value="<?php echo $this->wc_options_serialize->wc_held_comment_to_moderate; ?>" name="wc_held_comment_to_moderate" id="wc_held_comment_to_moderate" />
83
+ </label>
84
+ </td>
85
+ </tr>
86
+
87
+ <tr valign="top">
88
+ <th scope="row">
89
+ <?php _e('Hide Reply button for Guests', 'wpdiscuz'); ?>
90
+ </th>
91
+ <td colspan="3">
92
+ <label for="wc_reply_button_guests_show_hide">
93
+ <input type="checkbox" <?php checked($this->wc_options_serialize->wc_reply_button_guests_show_hide == 1) ?> value="<?php echo $this->wc_options_serialize->wc_reply_button_guests_show_hide; ?>" name="wc_reply_button_guests_show_hide" id="wc_reply_button_guests_show_hide" />
94
+ </label>
95
+ </td>
96
+ </tr>
97
+
98
+ <tr valign="top">
99
+ <th scope="row">
100
+ <?php _e('Hide Reply button for Members', 'wpdiscuz'); ?>
101
+ </th>
102
+ <td colspan="3">
103
+ <label for="wc_reply_button_members_show_hide">
104
+ <input type="checkbox" <?php checked($this->wc_options_serialize->wc_reply_button_members_show_hide == 1) ?> value="<?php echo $this->wc_options_serialize->wc_reply_button_members_show_hide; ?>" name="wc_reply_button_members_show_hide" id="wc_reply_button_members_show_hide" />
105
+ </label>
106
+ </td>
107
+ </tr>
108
+
109
+ <tr valign="top">
110
+ <th scope="row">
111
+ <?php _e('Hide Author Titles', 'wpdiscuz'); ?>
112
+ </th>
113
+ <td colspan="3">
114
+ <label for="wc_author_titles_show_hide">
115
+ <input type="checkbox" <?php checked($this->wc_options_serialize->wc_author_titles_show_hide == 1) ?> value="<?php echo $this->wc_options_serialize->wc_author_titles_show_hide; ?>" name="wc_author_titles_show_hide" id="wc_author_titles_show_hide" />
116
+ </label>
117
+ </td>
118
+ </tr>
119
+
120
+ <tr valign="top">
121
+ <th scope="row">
122
+ <?php _e('Comment Threads Per Page', 'wpdiscuz'); ?>
123
+ </th>
124
+ <td colspan="3">
125
+ <label for="wc_comment_count">
126
+ <input type="number" value="<?php echo $this->wc_options_serialize->wc_comment_count; ?>" name="wc_comment_count" id="wc_comment_count" />
127
+ </label><br/>
128
+ </td>
129
+ </tr>
130
+
131
+ <tr valign="top">
132
+ <th scope="row">
133
+ <?php _e('Notify moderator on new comment', 'wpdiscuz'); ?>
134
+ </th>
135
+ <td colspan="3">
136
+ <label for="wc_notify_moderator">
137
+ <input type="checkbox" <?php checked($this->wc_options_serialize->wc_notify_moderator == 1) ?> value="<?php echo $this->wc_options_serialize->wc_notify_moderator; ?>" name="wc_notify_moderator" id="wc_notify_moderator" />
138
+ </label>
139
+ </td>
140
+ </tr>
141
+
142
+ <tr valign="top">
143
+ <th scope="row">
144
+ <?php _e('Notify comment author on new reply', 'wpdiscuz'); ?>
145
+ </th>
146
+ <td colspan="3">
147
+ <label for="wc_notify_comment_author">
148
+ <input type="checkbox" <?php checked($this->wc_options_serialize->wc_notify_comment_author == 1) ?> value="<?php echo $this->wc_options_serialize->wc_notify_comment_author; ?>" name="wc_notify_comment_author" id="wc_notify_comment_author" />
149
+ </label>
150
+ </td>
151
+ </tr>
152
+
153
+ <tr valign="top">
154
+ <th scope="row">
155
+ <label for="wc_comment_bg_color"><?php _e('Comment Background Color', 'wpdiscuz'); ?></label>
156
+ </th>
157
+ <td width="1">
158
+ <input type="text" class="regular-text" value="<?php echo $this->wc_options_serialize->wc_comment_bg_color; ?>" id="wc_comment_bg_color" name="wc_comment_bg_color" placeholder="<?php _e('Example: #00ff00', 'wpdiscuz'); ?>"/>
159
+ </td>
160
+
161
+ <td class="picker_img_cell">
162
+ <a href="#wc_openModal1">
163
+ <img class="wc_colorpicker_img1" src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/colorpicker/img/colorpicker_icon_22.png'); ?>" />
164
+ </a>
165
+ </td>
166
+ <td class="color_picker">
167
+ <div id="wc_openModal1" class="modalDialog">
168
+ <div id="wc_box1">
169
+ <a href="#close" title="Close" class="close">X</a>
170
+ <h2>Color Picker</h2>
171
+ <p id="wc_colorpickerHolder1"></p>
172
+ </div>
173
+ </div>
174
+ </td>
175
+ </tr>
176
+
177
+ <tr valign="top">
178
+ <th scope="row">
179
+ <label for="wc_reply_bg_color"><?php _e('Reply Background Color', 'wpdiscuz'); ?></label>
180
+ </th>
181
+ <td>
182
+ <input type="text" class="regular-text" value="<?php echo $this->wc_options_serialize->wc_reply_bg_color; ?>" id="wc_reply_bg_color" name="wc_reply_bg_color" placeholder="<?php _e('Example: #00ff00', 'wpdiscuz'); ?>"/>
183
+ </td>
184
+
185
+ <td class="picker_img_cell">
186
+ <a href="#wc_openModal2">
187
+ <img class="wc_colorpicker_img2" src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/colorpicker/img/colorpicker_icon_22.png'); ?>" />
188
+ </a>
189
+ </td>
190
+ <td class="color_picker">
191
+ <div id="wc_openModal2" class="modalDialog">
192
+ <div id="wc_box2">
193
+ <a href="#close" title="Close" class="close">X</a>
194
+ <h2>Color Picker</h2>
195
+ <p id="wc_colorpickerHolder2"></p>
196
+ </div>
197
+ </div>
198
+ </td>
199
+ </tr>
200
+
201
+ <tr valign="top">
202
+ <th scope="row">
203
+ <label for="wc_comment_text_color"><?php _e('Comment Text Color', 'wpdiscuz'); ?></label>
204
+ </th>
205
+ <td>
206
+ <input type="text" class="regular-text" value="<?php echo $this->wc_options_serialize->wc_comment_text_color; ?>" id="wc_comment_text_color" name="wc_comment_text_color" placeholder="<?php _e('Example: #00ff00', 'wpdiscuz'); ?>"/>
207
+ </td>
208
+
209
+ <td class="picker_img_cell">
210
+ <a href="#wc_openModal3">
211
+ <img class="wc_colorpicker_img3" src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/colorpicker/img/colorpicker_icon_22.png'); ?>" />
212
+ </a>
213
+ </td>
214
+ <td class="color_picker">
215
+ <div id="wc_openModal3" class="modalDialog">
216
+ <div id="wc_box3">
217
+ <a href="#close" title="Close" class="close">X</a>
218
+ <h2>Color Picker</h2>
219
+ <p id="wc_colorpickerHolder3"></p>
220
+ </div>
221
+ </div>
222
+ </td>
223
+ </tr>
224
+
225
+
226
+ <tr valign="top">
227
+ <th scope="row">
228
+ <label for="wc_author_title_color"><?php _e('Author title color', 'wpdiscuz'); ?></label>
229
+ </th>
230
+ <td>
231
+ <input type="text" class="regular-text" value="<?php echo $this->wc_options_serialize->wc_author_title_color; ?>" id="wc_author_title_color" name="wc_author_title_color" placeholder="<?php _e('Example: #00ff00', 'wpdiscuz'); ?>"/>
232
+ </td>
233
+
234
+ <td class="picker_img_cell">
235
+ <a href="#wc_openModal4">
236
+ <img class="wc_colorpicker_img4" src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/colorpicker/img/colorpicker_icon_22.png'); ?>" />
237
+ </a>
238
+ </td>
239
+ <td class="color_picker">
240
+ <div id="wc_openModal4" class="modalDialog">
241
+ <div id="wc_box4">
242
+ <a href="#close" title="Close" class="close">X</a>
243
+ <h2>Color Picker</h2>
244
+ <p id="wc_colorpickerHolder4"></p>
245
+ </div>
246
+ </div>
247
+ </td>
248
+ </tr>
249
+
250
+
251
+ <tr valign="top">
252
+ <th scope="row">
253
+ <label for="wc_vote_reply_color"><?php _e('Vote, Reply, Share, Edit links text colors', 'wpdiscuz'); ?></label>
254
+ </th>
255
+ <td>
256
+ <input type="text" class="regular-text" value="<?php echo $this->wc_options_serialize->wc_vote_reply_color; ?>" id="wc_vote_reply_color" name="wc_vote_reply_color" placeholder="<?php _e('Example: #00ff00', 'wpdiscuz'); ?>"/>
257
+ </td>
258
+
259
+ <td class="picker_img_cell">
260
+ <a href="#wc_openModal5">
261
+ <img class="wc_colorpicker_img5" src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/colorpicker/img/colorpicker_icon_22.png'); ?>" />
262
+ </a>
263
+ </td>
264
+ <td class="color_picker">
265
+ <div id="wc_openModal5" class="modalDialog">
266
+ <div id="wc_box5">
267
+ <a href="#close" title="Close" class="close">X</a>
268
+ <h2>Color Picker</h2>
269
+ <p id="wc_colorpickerHolder5"></p>
270
+ </div>
271
+ </div>
272
+ </td>
273
+ </tr>
options-templates/options-template-phrases.php ADDED
@@ -0,0 +1,515 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <th colspan="3" scope="col" style="margin-bottom: 5px;"><h2><?php _e('Front-end phrases', 'wpdiscuz'); ?></h2></th>
2
+
3
+ <tr valign="top">
4
+ <th scope="row">
5
+ <?php _e('Comment', 'wpdiscuz'); ?>
6
+ </th>
7
+ <td colspan="3">
8
+ <label for="wc_header_text">
9
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_header_text']; ?>" name="wc_header_text" id="wc_header_text" />
10
+ </label>
11
+ </td>
12
+ </tr>
13
+
14
+ <tr valign="top">
15
+ <th scope="row">
16
+ <?php _e('On', 'wpdiscuz'); ?>
17
+ </th>
18
+ <td colspan="3">
19
+ <label for="wc_header_on_text">
20
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_header_on_text']; ?>" name="wc_header_on_text" id="wc_header_on_text" />
21
+ </label>
22
+ </td>
23
+ </tr>
24
+
25
+ <tr valign="top">
26
+ <th scope="row">
27
+ <?php _e('Comment Field Start', 'wpdiscuz'); ?>
28
+ </th>
29
+ <td colspan="3">
30
+ <label for="wc_comment_start_text">
31
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_comment_start_text']; ?>" name="wc_comment_start_text" id="wc_comment_start_text" />
32
+ </label>
33
+ </td>
34
+ </tr>
35
+
36
+ <tr valign="top">
37
+ <th scope="row">
38
+ <?php _e('Comment Field Join', 'wpdiscuz'); ?>
39
+ </th>
40
+ <td colspan="3">
41
+ <label for="wc_comment_join_text">
42
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_comment_join_text']; ?>" name="wc_comment_join_text" id="wc_comment_join_text" />
43
+ </label>
44
+ </td>
45
+ </tr>
46
+
47
+ <tr valign="top">
48
+ <th scope="row">
49
+ <?php _e('Email Field', 'wpdiscuz'); ?>
50
+ </th>
51
+ <td colspan="3">
52
+ <label for="wc_email_text">
53
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_email_text']; ?>" name="wc_email_text" id="wc_email_text" />
54
+ </label>
55
+ </td>
56
+ </tr>
57
+
58
+ <tr valign="top">
59
+ <th scope="row">
60
+ <?php _e('Name Field', 'wpdiscuz'); ?>
61
+ </th>
62
+ <td colspan="3">
63
+ <label for="wc_name_text">
64
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_name_text']; ?>" name="wc_name_text" id="wc_email_text" />
65
+ </label>
66
+ </td>
67
+ </tr>
68
+
69
+ <tr valign="top">
70
+ <th scope="row">
71
+ <?php _e('CAPTCHA Field', 'wpdiscuz'); ?>
72
+ </th>
73
+ <td colspan="3">
74
+ <label for="wc_captcha_text">
75
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_captcha_text']; ?>" name="wc_captcha_text" id="wc_email_text" />
76
+ </label>
77
+ </td>
78
+ </tr>
79
+
80
+ <tr valign="top">
81
+ <th scope="row">
82
+ <?php _e('Submit Button', 'wpdiscuz'); ?>
83
+ </th>
84
+ <td colspan="3">
85
+ <label for="wc_submit_text">
86
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_submit_text']; ?>" name="wc_submit_text" id="wc_submit_text" />
87
+ </label>
88
+ </td>
89
+ </tr>
90
+
91
+ <tr valign="top">
92
+ <th scope="row">
93
+ <?php _e('Load More Button', 'wpdiscuz'); ?>
94
+ </th>
95
+ <td colspan="3">
96
+ <label for="wc_load_more_submit_text">
97
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_load_more_submit_text']; ?>" name="wc_load_more_submit_text" id="wc_load_more_submit_text" />
98
+ </label>
99
+ </td>
100
+ </tr>
101
+
102
+ <tr valign="top">
103
+ <th scope="row">
104
+ <?php _e('Reply', 'wpdiscuz'); ?>
105
+ </th>
106
+ <td colspan="3">
107
+ <label for="wc_reply_text">
108
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_reply_text']; ?>" name="wc_reply_text" id="wc_submit_text" />
109
+ </label>
110
+ </td>
111
+ </tr>
112
+
113
+ <tr valign="top">
114
+ <th scope="row">
115
+ <?php _e('Share', 'wpdiscuz'); ?>
116
+ </th>
117
+ <td colspan="3">
118
+ <label for="wc_share_text">
119
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_share_text']; ?>" name="wc_share_text" id="wc_share_text" />
120
+ </label>
121
+ </td>
122
+ </tr>
123
+
124
+ <tr valign="top">
125
+ <th scope="row">
126
+ <?php _e('Share On Facebook', 'wpdiscuz'); ?>
127
+ </th>
128
+ <td colspan="3">
129
+ <label for="wc_share_facebook">
130
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_share_facebook']; ?>" name="wc_share_facebook" id="wc_share_facebook" />
131
+ </label>
132
+ </td>
133
+ </tr>
134
+
135
+ <tr valign="top" >
136
+ <th scope="row">
137
+ <?php _e('Share On Twitter', 'wpdiscuz'); ?>
138
+ </th>
139
+ <td colspan="3">
140
+ <label for="wc_share_twitter">
141
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_share_twitter']; ?>" name="wc_share_twitter" id="wc_share_twitter" />
142
+ </label>
143
+ </td>
144
+ </tr>
145
+
146
+ <tr valign="top">
147
+ <th scope="row">
148
+ <?php _e('Share On Google', 'wpdiscuz'); ?>
149
+ </th>
150
+ <td colspan="3">
151
+ <label for="wc_share_google">
152
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_share_google']; ?>" name="wc_share_google" id="wc_share_google" />
153
+ </label>
154
+ </td>
155
+ </tr>
156
+
157
+ <tr valign="top" >
158
+ <th scope="row">
159
+ <?php _e('Hide Replies', 'wpdiscuz'); ?>
160
+ </th>
161
+ <td colspan="3">
162
+ <label for="wc_hide_replies_text">
163
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_hide_replies_text']; ?>" name="wc_hide_replies_text" id="wc_hide_replies_text" />
164
+ </label>
165
+ </td>
166
+ </tr>
167
+
168
+ <tr valign="top">
169
+ <th scope="row">
170
+ <?php _e('Show Replies', 'wpdiscuz'); ?>
171
+ </th>
172
+ <td colspan="3">
173
+ <label for="wc_show_replies_text">
174
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_show_replies_text']; ?>" name="wc_show_replies_text" id="wc_show_replies_text" />
175
+ </label>
176
+ </td>
177
+ </tr>
178
+
179
+ <tr valign="top">
180
+ <th scope="row">
181
+ <?php _e('Title For Guests', 'wpdiscuz'); ?>
182
+ </th>
183
+ <td colspan="3">
184
+ <label for="wc_user_title_guest_text">
185
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_user_title_guest_text']; ?>" name="wc_user_title_guest_text" id="wc_user_title_guest_text" />
186
+ </label>
187
+ </td>
188
+ </tr>
189
+
190
+ <tr valign="top">
191
+ <th scope="row">
192
+ <?php _e('Title For Members', 'wpdiscuz'); ?>
193
+ </th>
194
+ <td colspan="3">
195
+ <label for="wc_user_title_member_text">
196
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_user_title_member_text']; ?>" name="wc_user_title_member_text" id="wc_user_title_member_text" />
197
+ </label>
198
+ </td>
199
+ </tr>
200
+
201
+
202
+
203
+
204
+ <tr valign="top">
205
+ <th scope="row">
206
+ <?php _e('Title For Authors', 'wpdiscuz'); ?>
207
+ </th>
208
+ <td colspan="3">
209
+ <label for="wc_user_title_author_text">
210
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_user_title_author_text']; ?>" name="wc_user_title_author_text" id="wc_user_title_author_text" />
211
+ </label>
212
+ </td>
213
+ </tr>
214
+
215
+ <tr valign="top">
216
+ <th scope="row">
217
+ <?php _e('Title For Admins', 'wpdiscuz'); ?>
218
+ </th>
219
+ <td colspan="3">
220
+ <label for="wc_user_title_admin_text">
221
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_user_title_admin_text']; ?>" name="wc_user_title_admin_text" id="wc_user_title_admin_text" />
222
+ </label>
223
+ </td>
224
+ </tr>
225
+
226
+
227
+
228
+
229
+
230
+
231
+ <tr valign="top">
232
+ <th scope="row">
233
+ <?php _e('Email Subject', 'wpdiscuz'); ?>
234
+ </th>
235
+ <td colspan="3">
236
+ <label for="wc_email_subject">
237
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_email_subject']; ?>" name="wc_email_subject" id="wc_email_subject" />
238
+ </label>
239
+ </td>
240
+ </tr>
241
+
242
+ <tr valign="top">
243
+ <th scope="row">
244
+ <?php _e('Email Message', 'wpdiscuz'); ?>
245
+ </th>
246
+ <td colspan="3">
247
+ <label for="wc_email_message">
248
+ <textarea name="wc_email_message" id="wc_email_message"><?php echo $this->wc_options_serialize->wc_phrases['wc_email_message']; ?></textarea>
249
+ </label>
250
+ </td>
251
+ </tr>
252
+
253
+ <tr valign="top">
254
+ <th scope="row">
255
+ <?php _e('Error message for empty field', 'wpdiscuz'); ?>
256
+ </th>
257
+ <td colspan="3">
258
+ <label for="wc_error_empty_text">
259
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_error_empty_text']; ?>" name="wc_error_empty_text" id="wc_error_empty_text" />
260
+ </label>
261
+ </td>
262
+ </tr>
263
+
264
+ <tr valign="top">
265
+ <th scope="row">
266
+ <?php _e('Error message for invalid email field', 'wpdiscuz'); ?>
267
+ </th>
268
+ <td colspan="3">
269
+ <label for="wc_error_email_text">
270
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_error_email_text']; ?>" name="wc_error_email_text" id="wc_error_email_text" />
271
+ </label>
272
+ </td>
273
+ </tr>
274
+
275
+ <tr valign="top">
276
+ <th scope="row">
277
+ <?php _e('Year', 'wpdiscuz'); ?>
278
+ </th>
279
+ <td colspan="3">
280
+ <label for="wc_year_text">
281
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_year_text']['datetime'][0]; ?>" name="wc_year_text" id="wc_year_text" />
282
+ </label>
283
+ </td>
284
+ </tr>
285
+
286
+ <tr valign="top">
287
+ <th scope="row">
288
+ <?php _e('Month', 'wpdiscuz'); ?>
289
+ </th>
290
+ <td colspan="3">
291
+ <label for="wc_month_text">
292
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_month_text']['datetime'][0]; ?>" name="wc_month_text" id="wc_month_text" />
293
+ </label>
294
+ </td>
295
+ </tr>
296
+
297
+ <tr valign="top">
298
+ <th scope="row">
299
+ <?php _e('Day', 'wpdiscuz'); ?>
300
+ </th>
301
+ <td colspan="3">
302
+ <label for="wc_day_text">
303
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_day_text']['datetime'][0]; ?>" name="wc_day_text" id="wc_day_text" />
304
+ </label>
305
+ </td>
306
+ </tr>
307
+
308
+ <tr valign="top">
309
+ <th scope="row">
310
+ <?php _e('Hour', 'wpdiscuz'); ?>
311
+ </th>
312
+ <td colspan="3">
313
+ <label for="wc_hour_text">
314
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_hour_text']['datetime'][0]; ?>" name="wc_hour_text" id="wc_hour_text" />
315
+ </label>
316
+ </td>
317
+ </tr>
318
+
319
+ <tr valign="top">
320
+ <th scope="row">
321
+ <?php _e('Minute', 'wpdiscuz'); ?>
322
+ </th>
323
+ <td colspan="3">
324
+ <label for="wc_minute_text">
325
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_minute_text']['datetime'][0]; ?>" name="wc_minute_text" id="wc_minute_text" />
326
+ </label>
327
+ </td>
328
+ </tr>
329
+
330
+ <tr valign="top">
331
+ <th scope="row">
332
+ <?php _e('Second', 'wpdiscuz'); ?>
333
+ </th>
334
+ <td colspan="3">
335
+ <label for="wc_second_text">
336
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_second_text']['datetime'][0]; ?>" name="wc_second_text" id="wc_second_text" />
337
+ </label>
338
+ </td>
339
+ </tr>
340
+
341
+ <tr valign="top">
342
+ <th scope="row">
343
+ <?php _e('Plural (Ex. user -> user + s)', 'wpdiscuz'); ?>
344
+ </th>
345
+ <td colspan="3">
346
+ <label for="wc_plural_text">
347
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_plural_text']; ?>" name="wc_plural_text" id="wc_plural_text" />
348
+ </label>
349
+ </td>
350
+ </tr>
351
+
352
+ <tr valign="top">
353
+ <th scope="row">
354
+ <?php _e('Commented "right now" text', 'wpdiscuz'); ?>
355
+ </th>
356
+ <td colspan="3">
357
+ <label for="wc_right_now_text">
358
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_right_now_text']; ?>" name="wc_right_now_text" id="wc_right_now_text" />
359
+ </label>
360
+ </td>
361
+ </tr>
362
+
363
+ <tr valign="top">
364
+ <th scope="row">
365
+ <?php _e('Ago text', 'wpdiscuz'); ?>
366
+ </th>
367
+ <td colspan="3">
368
+ <label for="wc_ago_text">
369
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_ago_text']; ?>" name="wc_ago_text" id="wc_ago_text" />
370
+ </label>
371
+ </td>
372
+ </tr>
373
+
374
+ <tr valign="top">
375
+ <th scope="row">
376
+ <?php _e('You must be', 'wpdiscuz'); ?>
377
+ </th>
378
+ <td colspan="3">
379
+ <label for="wc_you_must_be_text">
380
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_you_must_be_text']; ?>" name="wc_you_must_be_text" id="wc_you_must_be_text" />
381
+ </label>
382
+ </td>
383
+ </tr>
384
+
385
+ <tr valign="top">
386
+ <th scope="row">
387
+ <?php _e('Logged In', 'wpdiscuz'); ?>
388
+ </th>
389
+ <td colspan="3">
390
+ <label for="wc_logged_in_text">
391
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_logged_in_text']; ?>" name="wc_logged_in_text" id="wc_logged_in_text" />
392
+ </label>
393
+ </td>
394
+ </tr>
395
+
396
+ <tr valign="top">
397
+ <th scope="row">
398
+ <?php _e('To post a comment', 'wpdiscuz'); ?>
399
+ </th>
400
+ <td colspan="3">
401
+ <label for="wc_to_post_comment_text">
402
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_to_post_comment_text']; ?>" name="wc_to_post_comment_text" id="wc_to_post_comment_text" />
403
+ </label>
404
+ </td>
405
+ </tr>
406
+
407
+ <tr valign="top">
408
+ <th scope="row">
409
+ <?php _e('Vote Up', 'wpdiscuz'); ?>
410
+ </th>
411
+ <td colspan="3">
412
+ <label for="wc_vote_up">
413
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_vote_up']; ?>" name="wc_vote_up" id="wc_vote_up" />
414
+ </label>
415
+ </td>
416
+ </tr>
417
+
418
+ <tr valign="top">
419
+ <th scope="row">
420
+ <?php _e('Vote Down', 'wpdiscuz'); ?>
421
+ </th>
422
+ <td colspan="3">
423
+ <label for="wc_vote_down">
424
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_vote_down']; ?>" name="wc_vote_down" id="wc_vote_down" />
425
+ </label>
426
+ </td>
427
+ </tr>
428
+
429
+ <tr valign="top">
430
+ <th scope="row">
431
+ <?php _e('Vote Counted', 'wpdiscuz'); ?>
432
+ </th>
433
+ <td colspan="3">
434
+ <label for="wc_vote_counted">
435
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_vote_counted']; ?>" name="wc_vote_counted" id="wc_vote_counted" />
436
+ </label>
437
+ </td>
438
+ </tr>
439
+
440
+ <tr valign="top">
441
+ <th scope="row">
442
+ <?php _e('You can vote only 1 time', 'wpdiscuz'); ?>
443
+ </th>
444
+ <td colspan="3">
445
+ <label for="wc_vote_only_one_time">
446
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_vote_only_one_time']; ?>" name="wc_vote_only_one_time" id="wc_vote_only_one_time" />
447
+ </label>
448
+ </td>
449
+ </tr>
450
+
451
+ <tr valign="top">
452
+ <th scope="row">
453
+ <?php _e('Voting Error', 'wpdiscuz'); ?>
454
+ </th>
455
+ <td colspan="3">
456
+ <label for="wc_voting_error">
457
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_voting_error']; ?>" name="wc_voting_error" id="wc_voting_error" />
458
+ </label>
459
+ </td>
460
+ </tr>
461
+
462
+ <tr valign="top">
463
+ <th scope="row">
464
+ <?php _e('Login To Vote', 'wpdiscuz'); ?>
465
+ </th>
466
+ <td colspan="3">
467
+ <label for="wc_login_to_vote">
468
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_login_to_vote']; ?>" name="wc_login_to_vote" id="wc_login_to_vote" />
469
+ </label>
470
+ </td>
471
+ </tr>
472
+
473
+ <tr valign="top">
474
+ <th scope="row">
475
+ <?php _e('You Cannot Vote On Your Comment', 'wpdiscuz'); ?>
476
+ </th>
477
+ <td colspan="3">
478
+ <label for="wc_self_vote">
479
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_self_vote']; ?>" name="wc_self_vote" id="wc_self_vote" />
480
+ </label>
481
+ </td>
482
+ </tr>
483
+
484
+ <tr valign="top">
485
+ <th scope="row">
486
+ <?php _e('Invalid Captcha Code', 'wpdiscuz'); ?>
487
+ </th>
488
+ <td colspan="3">
489
+ <label for="wc_invalid_captcha">
490
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_invalid_captcha']; ?>" name="wc_invalid_captcha" id="wc_invalid_captcha" />
491
+ </label>
492
+ </td>
493
+ </tr>
494
+
495
+ <tr valign="top">
496
+ <th scope="row">
497
+ <?php _e('Some of field value is invalid', 'wpdiscuz'); ?>
498
+ </th>
499
+ <td colspan="3">
500
+ <label for="wc_invalid_field">
501
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_invalid_field']; ?>" name="wc_invalid_field" id="wc_invalid_field" />
502
+ </label>
503
+ </td>
504
+ </tr>
505
+
506
+ <tr valign="top">
507
+ <th scope="row">
508
+ <?php _e('Comment waiting moderation', 'wpdiscuz'); ?>
509
+ </th>
510
+ <td colspan="3">
511
+ <label for="wc_held_for_moderate">
512
+ <input type="text" value="<?php echo $this->wc_options_serialize->wc_phrases['wc_held_for_moderate']; ?>" name="wc_held_for_moderate" id="wc_held_for_moderate" />
513
+ </label>
514
+ </td>
515
+ </tr>
readme.txt ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === wpDiscuz ===
2
+ Contributors: gVectors Team
3
+ Tags: Wordpress Comments, Post Comments, comments box, comments, discussions, comment template
4
+ Requires at least: 2.7
5
+ Tested up to: 4.0
6
+ Stable tag: 1.0.0
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ Better comment system. Wordpress post comments and discussion plugin. Allows your visitors discuss, vote for comments and share.
11
+
12
+ == Description ==
13
+
14
+ Better comment system. Wordpress post comments and discussion plugin. Allows your visitors discuss, vote for comments and share.
15
+
16
+ **wpDiscuz Features:**
17
+
18
+ * | **Front-end**
19
+ * | Adds a new comments box on posts page
20
+ * | Responsive comments form and comment threads design
21
+ * | Interactive, clean, simple and easy user interface and user experience
22
+ * | Fast and easy comment form with ajax validation and data submitting
23
+ * | Allows to create a new discussion thread and reply to existing comment
24
+ * | Ajax button "Load More Comments" instead of simple comments pagination
25
+ * | Fully integrated and compatible with Wordpress
26
+ * | Uses Wordpress Comment system with all managing functions and features
27
+ * | Uses WP Avatar System, fully compatible with BuddyPress and other profiling plugins
28
+ * | Secure and Anti-Spam features will not allow spammers to comment
29
+ * | Comment voting with positive and negative result
30
+ * | Smart voting system with tracking by logged-in user and cookies
31
+ * | Post sharing options: Facebook, Twitter and Google+
32
+ *
33
+ * | **Dashboard**
34
+ * | Options to turn On/Off Comment Voting and Sharing features
35
+ * | Option to hide/show CAPTCHA field on comment form
36
+ * | Option for "User Must be registered to comment"
37
+ * | Option to held new comments for moderation
38
+ * | Option to hide user labels/titles
39
+ * | Option to set number of comment threads per page (for "load more comments" button)
40
+ * | Option to notify administrators and comment authors on new comment/reply
41
+ * | Option to manage font color and comment/reply background colors
42
+ * | Front-end phrase managing options, you'll be able to translate or change all phrases
43
+
44
+ == Installation ==
45
+
46
+ 1. Upload plugin folder to the '/wp-content/plugins/' directory,
47
+ 2. Activate the plugin through the 'Plugins' menu in WordPress.
48
+
49
+ == Frequently Asked Questions ==
50
+
51
+ = Please Check the Following wpDiscuz Resources =
52
+
53
+ * Support Forum: <http://gvectors.com/questions/>
54
+
55
+ == Changelog ==
56
+
57
+ = 1.0.0 =
58
+ Initial version
tasks.txt ADDED
File without changes
wc-css.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WC_CSS {
4
+ private $wc_options;
5
+
6
+ function __construct($wc_options) {
7
+ $this->wc_options = $wc_options;
8
+ }
9
+
10
+ /**
11
+ * init woo discuss styles
12
+ */
13
+ public function init_styles() {
14
+ ?>
15
+ <style type="text/css">
16
+ #wpcomm form .item {display: block;} .item input {}
17
+ #wpcomm { margin:10px auto; width:99%; padding:15px; border:#CCCCCC dotted 1px; }
18
+ #wpcomm form { margin:0px; padding:0px; background:none; border:none; }
19
+ #wpcomm form div{ margin:0px; }
20
+ #wpcomm .wc-form-wrapper{ padding:10px; background:#F9F9F9; margin-top:10px; border:1px solid #F1F1F1; }
21
+ #wpcomm .wc-author-data{ margin-bottom:10px; }
22
+ #wpcomm .wc-field-submit{ padding:5px 0px 13px 0px; }
23
+ #wpcomm .wc-field-name{ width:49%; float:left; }
24
+ #wpcomm .wc-field-email{ width:49%; float:right; text-align:right; }
25
+ #wpcomm .wc-field-comment{ margin:5px auto 10px auto; }
26
+ #wpcomm .wc-field-captcha{ width:55%; float:left; margin:0px; }
27
+ #wpcomm .wc-field-submit{ width:45%; float:right; text-align:right; margin:0px; }
28
+ #wpcomm .wc-field-name input[type="text"]{ width:95%; max-width:100%; padding:5px; font-size:14px; margin:0px; }
29
+ #wpcomm .wc-field-email input[type="email"]{ width:100%; max-width:100%; padding:5px; font-size:14px; margin:0px; }
30
+ #wpcomm .wc-field-captcha input[type="text"]{ width:40%; padding:5px; font-size:14px; margin:0px; }
31
+ #wpcomm .wc-field-submit input[type="submit"]{ margin:1px; }
32
+ #wpcomm .wc-field-submit input[type="button"]{ margin:1px; }
33
+ #wpcomm .captcha_msg{ color: #aaaaaa; font-family: Lato,sans-serif; font-size: 12px; line-height: 18px; display:block; clear:both; }
34
+ #wpcomm .wc-field-comment textarea{ width:100%; max-width:100%; height:43px; min-height: 43px !important; padding:5px; box-sizing: border-box; }
35
+ #wpcomm .wc-label{ display:block; font-size:14px; padding:5px; }
36
+ #wpcomm .wc-field-captcha .wc-label{ font-size:18px; padding:5px; text-align:center; display:inline; }
37
+ #wpcomm input[type="text"], #wpcomm input[type="email"], #wpcomm textarea{ font-size:14px; color:#666666; font-family:Lato,sans-serif; box-sizing: border-box; margin:0px; }
38
+ #wpcomm .wc-copyright{ margin: 0px 0px 0px auto; text-align:right; display: block; padding-top: 2px; }
39
+ #wpcomm .wc-copyright a{ font-size: 9px; color: #AAAAAA; cursor:help; text-decoration:none; margin:0px; padding:0px; border:none;}
40
+ #wpcomm .wc-thread-wrapper{ padding:10px 0px; margin-bottom:30px;}
41
+ #wpcomm .wc-comment { margin-bottom:13px; }
42
+ #wpcomm .wc-comment .wc-field-submit{ padding:5px 0px 5px 0px; }
43
+ #wpcomm .wc-comment .wc-form-wrapper{ padding:10px 10px 2px 10px; }
44
+ #wpcomm .wc-comment .wc-comment-left{ width:62px; float:left; position:absolute; text-align:center; font-family:Lato,sans-serif; line-height:16px; }
45
+ #wpcomm .wc-comment .wc-comment-right{ margin-left:70px; border:#F5F5F5 1px solid; padding:10px 10px 3px 10px; background:<?php echo $this->wc_options->wc_options_serialize->wc_comment_bg_color; ?>}
46
+ #wpcomm .wc-reply .wc-comment-right{ margin-left:70px; border:#F5F5F5 1px solid; padding:10px 10px 3px 10px; }
47
+ #wpcomm .wc-reply { margin-top: 10px; margin-bottom:0px; margin-left:40px; }
48
+ #wpcomm .wc-reply .wc-comment-right{ background:<?php echo $this->wc_options->wc_options_serialize->wc_reply_bg_color; ?>; }
49
+ #wpcomm .wc-comment-title{ margin:0px; font-size:18px; line-height:18px; font-weight:bold; padding:10px; margin-bottom:10px; }
50
+ #wpcomm .wc-must-login{ margin:0px; font-size:14px; line-height:16px; padding:10px }
51
+ #wpcomm hr{ background-color: rgba(0, 0, 0, 0.1); border: 0 none; height: 1px; margin:10px 0px; }
52
+ #wpcomm .avatar{ border: 1px solid rgba(0, 0, 0, 0.1); padding: 2px; margin:0px; float:none; }
53
+ #wpcomm .wc-comment-text{ font-size:13px; text-align:left; color:<?php echo $this->wc_options->wc_options_serialize->wc_comment_text_color; ?>; }
54
+ #wpcomm .wc-comment-header{ margin-bottom:7px; font-family:Lato,sans-serif; }
55
+ #wpcomm .wc-comment-author{ color:<?php echo $this->wc_options->wc_options_serialize->wc_author_title_color; ?>; font-size:16px; width:40%; float:left; white-space:nowrap; }
56
+ #wpcomm .wc-comment-label{ background:<?php echo $this->wc_options->wc_options_serialize->wc_author_title_color; ?>; color:#FFFFFF; padding:2px 5px; font-size:12px; margin:4px auto; text-align:center; display:table; line-height:16px; }
57
+ #wpcomm .wc-comment-date{ font-size:12px; color:#999999; width:59%; float:right; text-align:right; white-space:nowrap; line-height:27px; }
58
+ #wpcomm .wc-comment-footer { font-size:12px; font-weight:normal; color:#999999; margin-top:10px; min-height: 28px; font-family:Lato,sans-serif; }
59
+ #wpcomm .wc-comment-footer a{ text-decoration:none; font-size:13px; font-weight:bold; color:<?php echo $this->wc_options->wc_options_serialize->wc_vote_reply_color; ?>; }
60
+ #wpcomm .wc-comment-footer .share_buttons_box img{ vertical-align:middle; }
61
+ #wpcomm .wc-comment-footer .wc-voted{ color:#666666; cursor:default; }
62
+ #wpcomm .wc-comment-footer .wc-vote-result{ padding:2px 6px 2px 5px; background:<?php echo $this->wc_options->wc_options_serialize->wc_vote_reply_color; ?>; color:#FFFFFF; font-size:12px; font-weight:bold; display:inline; margin-right:5px;}
63
+ #wpcomm .wc-toggle{ float:right; text-align:right; padding-right:0px; margin-right:0px; color:#999999; cursor:pointer; font-size:12px; }
64
+ #wpcomm .item { background: none; border-radius: 0px; box-shadow: none; }
65
+ #wc_response_info img{ margin: 0px auto 0px auto; }
66
+ #wpcomm .share_buttons_box img { display:inline!important; width:16px; height:16px; }
67
+ #wpcomm .wc-captcha-label img{ display: inline!important; border:none; padding:0px 1px; margin:0px; }
68
+ #wpcomm .wc-reply-link, #wpcomm .wc-vote-link, #wpcomm .wc-share-link { cursor: pointer; font-size:13px; font-weight:bold; color: <?php echo $this->wc_options->wc_options_serialize->wc_vote_reply_color; ?>; }
69
+ #wpcomm .wc-form-footer, #wpcomm .wc-secondary-forms-wrapper {display: none;}
70
+ #wpcomm .wc-field-captcha .wc-captcha-label { margin-left: 5px; padding: 0; display: inline-block; }
71
+ #wpcomm .wc_captcha_refresh_img {cursor: pointer; margin-left: 3px;}
72
+ #wpcomm .share_buttons_box {display: none;/*position: absolute;left: 40%;*/}
73
+ #wpcomm .wc-no-left-margin {margin-left: 0 !important;}
74
+ div.wc_modal { background: none repeat scroll 0 0 #EDEDED; color:#444444; font-size: 18px; font-weight: normal; padding: 45px 10px 50px 10px!important; text-align: center; line-height:25px;}
75
+ .wc-load-more-submit-wrap { width: 100%; text-align: center; }
76
+ .wc-load-more-submit { width: 100%; text-align: center; }
77
+ #wc_openModalFormAction > div#wc_response_info { width: 200px; background: none repeat scroll 0 0 #EDEDED; color:#444444; font-size: 18px; font-weight: normal; padding: 45px 10px 50px 10px!important; text-align: center; line-height:25px;}
78
+ #wc_openModalFormAction > div#wc_response_info { /*z-index: 10000;*/ }
79
+ #wc_openModalFormAction > div#wc_response_info a.close { background: url("<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/x.png'); ?>") no-repeat; background-position-x: right; background-position-y: top; }
80
+ </style>
81
+ <?php
82
+ }
83
+
84
+ }
85
+ ?>
wc-options-serialize.php ADDED
@@ -0,0 +1,294 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include_once 'includes/wc-db-helper.php';
4
+
5
+ class WC_Options_Serialize {
6
+
7
+ public $wc_options_slug = 'wc_options';
8
+
9
+ /* Type - Checkbox array
10
+ * Available Values - Checked/Unchecked
11
+ * Description - On which post types display comment form
12
+ * Default Value - Post
13
+ */
14
+ public $wc_post_types = array('post');
15
+
16
+ /* Type - Checkbox
17
+ * Available Values - Checked/Unchecked
18
+ * Description - Show/Hide Voting buttons
19
+ * Default Value - Unchecked
20
+ */
21
+ public $wc_voting_buttons_show_hide;
22
+
23
+ /*
24
+ * Type - Checkbox
25
+ * Available Values - Checked/Unchecked
26
+ * Description - Show/Hide Share Buttons
27
+ * Default Value - Unchecked
28
+ */
29
+ public $wc_share_buttons_show_hide;
30
+
31
+ /*
32
+ * Type - Checkbox
33
+ * Available Values - Checked/Unchecked
34
+ * Description - Show/Hide the CAPTCHA field
35
+ * Default Value - Unchecked
36
+ */
37
+ public $wc_captcha_show_hide;
38
+
39
+ /*
40
+ * Type - Radiobutton
41
+ * Available Values - Yes/No
42
+ * Description - User Must be registered to comment
43
+ * (If this option is set “Yes”, the comment form will be hidden,
44
+ * instead of the form there will be a link to registration page.)
45
+ * Default Value - No
46
+ */
47
+ public $wc_user_must_be_registered;
48
+
49
+ /*
50
+ * Type - Checkbox
51
+ * Available Values - Checked/Unchecked
52
+ * Description - If checked held the comment to approve manually
53
+ * Default Value - Unchecked
54
+ */
55
+ public $wc_held_comment_to_moderate;
56
+
57
+ /*
58
+ * Type - Checkbox
59
+ * Available Values - Checked/Unchecked
60
+ * Description - Show/Hide Reply button for Guests
61
+ * Default Value - Unchecked
62
+ */
63
+ public $wc_reply_button_guests_show_hide;
64
+
65
+ /*
66
+ * Type - Checkbox
67
+ * Available Values - Checked/Unchecked
68
+ * Description - Show/Hide Reply button for Customers
69
+ * Default Value - Unchecked
70
+ */
71
+ public $wc_reply_button_members_show_hide;
72
+
73
+ /*
74
+ * Type - Checkbox
75
+ * Available Values - Checked/Unchecked
76
+ * Description - Show/Hide Author Titles
77
+ * Default Value - Unchecked
78
+ */
79
+ public $wc_author_titles_show_hide;
80
+
81
+ /*
82
+ * Type - Input
83
+ * Available Values - Integer
84
+ * Description - Comment count per click
85
+ * Default Value - 5
86
+ */
87
+ public $wc_comment_count;
88
+
89
+ /*
90
+ * Type - Checkbox
91
+ * Available Values - Checked/Unchecked
92
+ * Description - Notify moderator on new comment
93
+ * Default Value - Checked
94
+ */
95
+ public $wc_notify_moderator;
96
+
97
+ /*
98
+ * Type - Checkbox
99
+ * Available Values - Checked/Unchecked
100
+ * Description - Notify comment author on new reply
101
+ * Default Value - Checked
102
+ */
103
+ public $wc_notify_comment_author;
104
+
105
+ /*
106
+ * Type - Input
107
+ * Available Values - color codes
108
+ * Description - Comment Background Color
109
+ * Default Value - #fefefe
110
+ */
111
+ public $wc_comment_bg_color;
112
+
113
+ /*
114
+ * Type - Input
115
+ * Available Values - color codes
116
+ * Description - Reply Background Color
117
+ * Default Value - #f8f8f8
118
+ */
119
+ public $wc_reply_bg_color;
120
+
121
+ /*
122
+ * Type - Input
123
+ * Available Values - color codes
124
+ * Description - Comment Text Color
125
+ * Default Value - #555
126
+ */
127
+ public $wc_comment_text_color;
128
+
129
+ /*
130
+ * Type - Input
131
+ * Available Values - color codes
132
+ * Description - Author title Color, Author title label color
133
+ * Default Value - #ad74a2
134
+ */
135
+ public $wc_author_title_color;
136
+
137
+ /*
138
+ * Type - Input
139
+ * Available Values - color codes
140
+ * Description - Vote, Reply, Share, Edit - text colors
141
+ * Default Value - #85ad74
142
+ */
143
+ public $wc_vote_reply_color;
144
+
145
+ /*
146
+ * Type - HTML elements array
147
+ * Available Values - Text
148
+ * Description - Phrases for form elements texts
149
+ * Default Value -
150
+ */
151
+ public $wc_phrases;
152
+ public $wc_db_helper;
153
+
154
+ function __construct($wc_db_helper) {
155
+ $this->wc_db_helper = $wc_db_helper;
156
+ $this->init_phrases();
157
+ $this->add_options();
158
+ $this->init_options(get_option($this->wc_options_slug));
159
+ add_action('plugins_loaded', array(&$this, 'init_phrases_on_load'), -126);
160
+ }
161
+
162
+ public function init_options($serialize_options) {
163
+ $options = unserialize($serialize_options);
164
+ $this->wc_post_types = $options['wc_post_types'];
165
+ $this->wc_voting_buttons_show_hide = $options['wc_voting_buttons_show_hide'];
166
+ $this->wc_share_buttons_show_hide = $options['wc_share_buttons_show_hide'];
167
+ $this->wc_captcha_show_hide = $options['wc_captcha_show_hide'];
168
+ $this->wc_user_must_be_registered = $options['wc_user_must_be_registered'];
169
+ $this->wc_held_comment_to_moderate = $options['wc_held_comment_to_moderate'];
170
+ $this->wc_reply_button_guests_show_hide = $options['wc_reply_button_guests_show_hide'];
171
+ $this->wc_reply_button_members_show_hide = $options['wc_reply_button_members_show_hide'];
172
+ $this->wc_author_titles_show_hide = $options['wc_author_titles_show_hide'];
173
+ $this->wc_comment_count = $options['wc_comment_count'];
174
+ $this->wc_notify_moderator = $options['wc_notify_moderator'];
175
+ $this->wc_notify_comment_author = $options['wc_notify_comment_author'];
176
+ $this->wc_comment_bg_color = $options['wc_comment_bg_color'];
177
+ $this->wc_reply_bg_color = $options['wc_reply_bg_color'];
178
+ $this->wc_comment_text_color = $options['wc_comment_text_color'];
179
+ $this->wc_author_title_color = $options['wc_author_title_color'];
180
+ $this->wc_vote_reply_color = $options['wc_vote_reply_color'];
181
+ }
182
+
183
+ /**
184
+ * initialize default phrases
185
+ */
186
+ public function init_phrases() {
187
+ $this->wc_phrases = array(
188
+ 'wc_header_text' => 'Comment',
189
+ 'wc_header_on_text' => 'on',
190
+ 'wc_comment_start_text' => 'Start the discussion',
191
+ 'wc_comment_join_text' => 'Join the discussion',
192
+ 'wc_email_text' => 'Email',
193
+ 'wc_name_text' => 'Name',
194
+ 'wc_captcha_text' => 'Please insert the code above to comment',
195
+ 'wc_submit_text' => 'Post Comment',
196
+ 'wc_load_more_submit_text' => 'Load More Comments',
197
+ 'wc_reply_text' => 'Reply',
198
+ 'wc_share_text' => 'Share',
199
+ 'wc_share_facebook' => 'Share On Facebook',
200
+ 'wc_share_twitter' => 'Share On Twitter',
201
+ 'wc_share_google' => 'Share On Google',
202
+ 'wc_hide_replies_text' => 'Hide Replies',
203
+ 'wc_show_replies_text' => 'Show Replies',
204
+ 'wc_user_title_guest_text' => 'Guest',
205
+ 'wc_user_title_member_text' => 'Member',
206
+ 'wc_user_title_author_text' => 'Author',
207
+ 'wc_user_title_admin_text' => 'Admin',
208
+ 'wc_email_subject' => 'New Comment',
209
+ 'wc_email_message' => 'New comment on the discussion section you\'ve been interested in',
210
+ 'wc_error_empty_text' => 'please fill out this field to comment',
211
+ 'wc_error_email_text' => 'email address is invalid',
212
+ 'wc_year_text' => array('datetime' => array('year', 1)),
213
+ 'wc_month_text' => array('datetime' => array('month', 2)),
214
+ 'wc_day_text' => array('datetime' => array('day', 3)),
215
+ 'wc_hour_text' => array('datetime' => array('hour', 4)),
216
+ 'wc_minute_text' => array('datetime' => array('minute', 5)),
217
+ 'wc_second_text' => array('datetime' => array('second', 6)),
218
+ 'wc_plural_text' => 's',
219
+ 'wc_right_now_text' => 'right now',
220
+ 'wc_ago_text' => 'ago',
221
+ 'wc_you_must_be_text' => 'You must be',
222
+ 'wc_logged_in_text' => 'logged in',
223
+ 'wc_to_post_comment_text' => 'to post a comment.',
224
+ 'wc_vote_up' => 'Vote Up',
225
+ 'wc_vote_down' => 'Vote Down',
226
+ 'wc_vote_counted' => 'Vote Counted',
227
+ 'wc_vote_only_one_time' => "You've already voted for this comment",
228
+ 'wc_voting_error' => 'Voting Error',
229
+ 'wc_login_to_vote' => 'You Must Be Logged In To Vote',
230
+ 'wc_self_vote' => 'You cannot vote for your comment',
231
+ 'wc_invalid_captcha' => 'Invalid Captcha Code',
232
+ 'wc_invalid_field' => 'Some of field value is invalid',
233
+ 'wc_held_for_moderate' => 'Your Comment awaiting moderation',
234
+ );
235
+ }
236
+
237
+ public function to_array() {
238
+ $options = array(
239
+ 'wc_post_types' => $this->wc_post_types,
240
+ 'wc_voting_buttons_show_hide' => $this->wc_voting_buttons_show_hide,
241
+ 'wc_share_buttons_show_hide' => $this->wc_share_buttons_show_hide,
242
+ 'wc_captcha_show_hide' => $this->wc_captcha_show_hide,
243
+ 'wc_user_must_be_registered' => $this->wc_user_must_be_registered,
244
+ 'wc_held_comment_to_moderate' => $this->wc_held_comment_to_moderate,
245
+ 'wc_reply_button_guests_show_hide' => $this->wc_reply_button_guests_show_hide,
246
+ 'wc_reply_button_members_show_hide' => $this->wc_reply_button_members_show_hide,
247
+ 'wc_author_titles_show_hide' => $this->wc_author_titles_show_hide,
248
+ 'wc_comment_count' => $this->wc_comment_count,
249
+ 'wc_notify_moderator' => $this->wc_notify_moderator,
250
+ 'wc_notify_comment_author' => $this->wc_notify_comment_author,
251
+ 'wc_comment_bg_color' => $this->wc_comment_bg_color,
252
+ 'wc_reply_bg_color' => $this->wc_reply_bg_color,
253
+ 'wc_comment_text_color' => $this->wc_comment_text_color,
254
+ 'wc_author_title_color' => $this->wc_author_title_color,
255
+ 'wc_vote_reply_color' => $this->wc_vote_reply_color
256
+ );
257
+
258
+ return $options;
259
+ }
260
+
261
+ public function update_options() {
262
+ update_option($this->wc_options_slug, serialize($this->to_array()));
263
+ }
264
+
265
+ public function add_options() {
266
+ $options = array(
267
+ 'wc_post_types' => $this->wc_post_types,
268
+ 'wc_voting_buttons_show_hide' => '0',
269
+ 'wc_share_buttons_show_hide' => '0',
270
+ 'wc_captcha_show_hide' => '0',
271
+ 'wc_user_must_be_registered' => '0',
272
+ 'wc_held_comment_to_moderate' => '1',
273
+ 'wc_reply_button_guests_show_hide' => '0',
274
+ 'wc_reply_button_members_show_hide' => '0',
275
+ 'wc_author_titles_show_hide' => '0',
276
+ 'wc_comment_count' => '5',
277
+ 'wc_notify_moderator' => '1',
278
+ 'wc_notify_comment_author' => '1',
279
+ 'wc_comment_bg_color' => '#fefefe',
280
+ 'wc_reply_bg_color' => '#f8f8f8',
281
+ 'wc_comment_text_color' => '#555',
282
+ 'wc_author_title_color' => '#ad74a2',
283
+ 'wc_vote_reply_color' => '#85ad74'
284
+ );
285
+ add_option($this->wc_options_slug, serialize($options));
286
+ }
287
+
288
+ public function init_phrases_on_load() {
289
+ if ($this->wc_db_helper->is_phrase_exists('wc_discuss_tab')) {
290
+ $this->wc_phrases = $this->wc_db_helper->get_phrases();
291
+ }
292
+ }
293
+
294
+ }
wc-options.php ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ include_once 'wc-options-serialize.php';
3
+ include_once 'includes/wc-db-helper.php';
4
+
5
+ class WC_Options {
6
+
7
+ public $wc_options_serialize;
8
+ public $wc_db_helper;
9
+ private $wc_post_types;
10
+
11
+ public function __construct() {
12
+ $this->wc_db_helper = new WC_DB_Helper();
13
+ $this->wc_options_serialize = new WC_Options_Serialize($this->wc_db_helper);
14
+ }
15
+
16
+ /**
17
+ * Builds options page
18
+ */
19
+ public function main_options_form() {
20
+
21
+ $default_post_types = get_post_types('', 'names');
22
+ foreach ($default_post_types as $post_type) {
23
+ if ($post_type != 'attachment' && $post_type != 'revision' && $post_type != 'nav_menu_item') {
24
+ $this->wc_post_types[] = $post_type;
25
+ }
26
+ }
27
+
28
+ if (isset($_POST['submit_options'])) {
29
+
30
+ if (function_exists('current_user_can') && !current_user_can('manage_options')) {
31
+ die(_e('Hacker?', 'wpdiscuz'));
32
+ }
33
+
34
+ if (function_exists('check_admin_referer')) {
35
+ check_admin_referer('wc_options_form');
36
+ }
37
+
38
+ $this->wc_options_serialize->wc_post_types = isset($_POST['wc_post_types']) ? $_POST['wc_post_types'] : array();
39
+ $this->wc_options_serialize->wc_voting_buttons_show_hide = isset($_POST['wc_voting_buttons_show_hide']) ? $_POST['wc_voting_buttons_show_hide'] : 0;
40
+ $this->wc_options_serialize->wc_share_buttons_show_hide = isset($_POST['wc_share_buttons_show_hide']) ? $_POST['wc_share_buttons_show_hide'] : 0;
41
+ $this->wc_options_serialize->wc_captcha_show_hide = isset($_POST['wc_captcha_show_hide']) ? $_POST['wc_captcha_show_hide'] : 0;
42
+ $this->wc_options_serialize->wc_user_must_be_registered = isset($_POST['wc_user_must_be_registered']) ? $_POST['wc_user_must_be_registered'] : 0;
43
+ $this->wc_options_serialize->wc_held_comment_to_moderate = isset($_POST['wc_held_comment_to_moderate']) ? $_POST['wc_held_comment_to_moderate'] : 0;
44
+ $this->wc_options_serialize->wc_reply_button_guests_show_hide = isset($_POST['wc_reply_button_guests_show_hide']) ? $_POST['wc_reply_button_guests_show_hide'] : 0;
45
+ $this->wc_options_serialize->wc_reply_button_members_show_hide = isset($_POST['wc_reply_button_members_show_hide']) ? $_POST['wc_reply_button_members_show_hide'] : 0;
46
+ $this->wc_options_serialize->wc_author_titles_show_hide = isset($_POST['wc_author_titles_show_hide']) ? $_POST['wc_author_titles_show_hide'] : 0;
47
+ $this->wc_options_serialize->wc_comment_count = isset($_POST['wc_comment_count']) ? $_POST['wc_comment_count'] : 10;
48
+ $this->wc_options_serialize->wc_notify_moderator = isset($_POST['wc_notify_moderator']) ? $_POST['wc_notify_moderator'] : 0;
49
+ $this->wc_options_serialize->wc_notify_comment_author = isset($_POST['wc_notify_comment_author']) ? $_POST['wc_notify_comment_author'] : 0;
50
+ $this->wc_options_serialize->wc_comment_bg_color = isset($_POST['wc_comment_bg_color']) ? $_POST['wc_comment_bg_color'] : '#fefefe';
51
+ $this->wc_options_serialize->wc_reply_bg_color = isset($_POST['wc_reply_bg_color']) ? $_POST['wc_reply_bg_color'] : '#f8f8f8';
52
+ $this->wc_options_serialize->wc_comment_text_color = isset($_POST['wc_comment_text_color']) ? $_POST['wc_comment_text_color'] : '#555';
53
+ $this->wc_options_serialize->wc_author_title_color = isset($_POST['wc_author_title_color']) ? $_POST['wc_author_title_color'] : '#ad74a2';
54
+ $this->wc_options_serialize->wc_vote_reply_color = isset($_POST['wc_vote_reply_color']) ? $_POST['wc_vote_reply_color'] : '#85ad74';
55
+
56
+ $this->wc_options_serialize->update_options();
57
+ }
58
+ ?>
59
+
60
+ <div class="wrap wpdiscuz_options_page">
61
+
62
+ <div style="float:left; width:50px; height:55px; margin:10px 10px 20px 0px;">
63
+ <img src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/plugin-icon/plugin-icon-48.png'); ?>" style="height:43px;"/>
64
+ </div>
65
+ <h2 style="padding-bottom:20px; padding-top:15px;"><?php _e('WpDiscuz General Settings', 'wpdiscuz'); ?></h2>
66
+ <br style="clear:both" />
67
+ <form action="<?php echo $_SERVER['PHP_SELF']; ?>?page=wpdiscuz_options_page&updated=true" method="post" name="wpdiscuz_options_page" class="wc-main-settings-form wc-form">
68
+ <?php
69
+ if (function_exists('wp_nonce_field')) {
70
+ wp_nonce_field('wc_options_form');
71
+ }
72
+ ?>
73
+ <table cellspacing="0" class="wp-list-table widefat plugins">
74
+ <thead>
75
+ <tr>
76
+ <th colspan="4" scope="col">&nbsp;</th>
77
+ </tr>
78
+ </thead>
79
+ <tfoot>
80
+ <tr>
81
+ <th colspan="4">&nbsp;</th>
82
+ </tr>
83
+ </tfoot>
84
+ <tbody>
85
+ <?php include 'options-templates/options-template-main.php'; ?>
86
+ <tr valign="top">
87
+ <td colspan="4">
88
+ <p class="submit">
89
+ <input type="submit" class="button button-primary" name="submit_options" value="<?php _e('Save Changes', 'wpdiscuz'); ?>" />
90
+ </p>
91
+ </td>
92
+ </tr>
93
+
94
+ <input type="hidden" name="action" value="update" />
95
+ </tbody>
96
+ </table>
97
+ </form>
98
+ </div>
99
+
100
+ <?php
101
+ }
102
+
103
+ public function phrases_options_form() {
104
+
105
+ if (isset($_POST['submit_phrases'])) {
106
+
107
+ if (function_exists('current_user_can') && !current_user_can('manage_options')) {
108
+ die(_e('Hacker?', 'wpdiscuz'));
109
+ }
110
+
111
+ if (function_exists('check_admin_referer')) {
112
+ check_admin_referer('wc_phrases_form');
113
+ }
114
+
115
+
116
+ $this->wc_options_serialize->wc_phrases['wc_header_text'] = isset($_POST['wc_header_text']) ? $_POST['wc_header_text'] : 'Comment';
117
+ $this->wc_options_serialize->wc_phrases['wc_header_on_text'] = isset($_POST['wc_header_on_text']) ? $_POST['wc_header_on_text'] : 'on';
118
+ $this->wc_options_serialize->wc_phrases['wc_comment_start_text'] = isset($_POST['wc_comment_start_text']) ? $_POST['wc_comment_start_text'] : 'Start the discussion';
119
+ $this->wc_options_serialize->wc_phrases['wc_comment_join_text'] = isset($_POST['wc_comment_join_text']) ? $_POST['wc_comment_join_text'] : 'Join the discussion';
120
+ $this->wc_options_serialize->wc_phrases['wc_email_text'] = isset($_POST['wc_email_text']) ? $_POST['wc_email_text'] : 'Email';
121
+ $this->wc_options_serialize->wc_phrases['wc_name_text'] = isset($_POST['wc_name_text']) ? $_POST['wc_name_text'] : 'Name';
122
+ $this->wc_options_serialize->wc_phrases['wc_captcha_text'] = isset($_POST['wc_captcha_text']) ? $_POST['wc_captcha_text'] : 'Please insert the code above to comment';
123
+ $this->wc_options_serialize->wc_phrases['wc_submit_text'] = isset($_POST['wc_submit_text']) ? $_POST['wc_submit_text'] : 'Post Comment';
124
+ $this->wc_options_serialize->wc_phrases['wc_load_more_submit_text'] = isset($_POST['wc_load_more_submit_text']) ? $_POST['wc_load_more_submit_text'] : 'Load More';
125
+ $this->wc_options_serialize->wc_phrases['wc_reply_text'] = isset($_POST['wc_reply_text']) ? $_POST['wc_reply_text'] : 'Reply';
126
+ $this->wc_options_serialize->wc_phrases['wc_share_text'] = isset($_POST['wc_share_text']) ? $_POST['wc_share_text'] : 'Share';
127
+ $this->wc_options_serialize->wc_phrases['wc_share_facebook'] = isset($_POST['wc_share_facebook']) ? $_POST['wc_share_facebook'] : 'Share On Facebook';
128
+ $this->wc_options_serialize->wc_phrases['wc_share_twitter'] = isset($_POST['wc_share_twitter']) ? $_POST['wc_share_twitter'] : 'Share On Twitter';
129
+ $this->wc_options_serialize->wc_phrases['wc_share_google'] = isset($_POST['wc_share_google']) ? $_POST['wc_share_google'] : 'Share On Google';
130
+ $this->wc_options_serialize->wc_phrases['wc_hide_replies_text'] = isset($_POST['wc_hide_replies_text']) ? $_POST['wc_hide_replies_text'] : 'Hide Replies';
131
+ $this->wc_options_serialize->wc_phrases['wc_show_replies_text'] = isset($_POST['wc_show_replies_text']) ? $_POST['wc_show_replies_text'] : 'Show Replies';
132
+ $this->wc_options_serialize->wc_phrases['wc_user_title_guest_text'] = isset($_POST['wc_user_title_guest_text']) ? $_POST['wc_user_title_guest_text'] : 'Guest';
133
+ $this->wc_options_serialize->wc_phrases['wc_user_title_member_text'] = isset($_POST['wc_user_title_member_text']) ? $_POST['wc_user_title_member_text'] : 'Member';
134
+ $this->wc_options_serialize->wc_phrases['wc_user_title_author_text'] = isset($_POST['wc_user_title_author_text']) ? $_POST['wc_user_title_author_text'] : 'Author';
135
+ $this->wc_options_serialize->wc_phrases['wc_user_title_admin_text'] = isset($_POST['wc_user_title_admin_text']) ? $_POST['wc_user_title_admin_text'] : 'Admin';
136
+ $this->wc_options_serialize->wc_phrases['wc_email_subject'] = isset($_POST['wc_email_subject']) ? $_POST['wc_email_subject'] : 'New Comment';
137
+ $this->wc_options_serialize->wc_phrases['wc_email_message'] = isset($_POST['wc_email_message']) ? $_POST['wc_email_message'] : 'New comment on the product discussion section you\'ve been interested in';
138
+ $this->wc_options_serialize->wc_phrases['wc_error_empty_text'] = isset($_POST['wc_error_empty_text']) ? $_POST['wc_error_empty_text'] : 'please fill out this field to comment';
139
+ $this->wc_options_serialize->wc_phrases['wc_error_email_text'] = isset($_POST['wc_error_email_text']) ? $_POST['wc_error_email_text'] : 'email address is invalid';
140
+
141
+ $this->wc_options_serialize->wc_phrases['wc_year_text']['datetime'][0] = isset($_POST['wc_year_text']) ? $_POST['wc_year_text'] : 'year';
142
+ $this->wc_options_serialize->wc_phrases['wc_month_text']['datetime'][0] = isset($_POST['wc_month_text']) ? $_POST['wc_month_text'] : 'month';
143
+ $this->wc_options_serialize->wc_phrases['wc_day_text']['datetime'][0] = isset($_POST['wc_day_text']) ? $_POST['wc_day_text'] : 'day';
144
+ $this->wc_options_serialize->wc_phrases['wc_hour_text']['datetime'][0] = isset($_POST['wc_hour_text']) ? $_POST['wc_hour_text'] : 'hour';
145
+ $this->wc_options_serialize->wc_phrases['wc_minute_text']['datetime'][0] = isset($_POST['wc_minute_text']) ? $_POST['wc_minute_text'] : 'minute';
146
+ $this->wc_options_serialize->wc_phrases['wc_second_text']['datetime'][0] = isset($_POST['wc_second_text']) ? $_POST['wc_second_text'] : 'second';
147
+ $this->wc_options_serialize->wc_phrases['wc_plural_text'] = isset($_POST['wc_plural_text']) ? $_POST['wc_plural_text'] : 's';
148
+ $this->wc_options_serialize->wc_phrases['wc_right_now_text'] = isset($_POST['wc_right_now_text']) ? $_POST['wc_right_now_text'] : 'right now';
149
+ $this->wc_options_serialize->wc_phrases['wc_ago_text'] = isset($_POST['wc_ago_text']) ? $_POST['wc_ago_text'] : 'ago';
150
+
151
+ $this->wc_options_serialize->wc_phrases['wc_you_must_be_text'] = isset($_POST['wc_you_must_be_text']) ? $_POST['wc_you_must_be_text'] : 'You must be';
152
+ $this->wc_options_serialize->wc_phrases['wc_logged_in_text'] = isset($_POST['wc_logged_in_text']) ? $_POST['wc_logged_in_text'] : 'logged in';
153
+ $this->wc_options_serialize->wc_phrases['wc_to_post_comment_text'] = isset($_POST['wc_to_post_comment_text']) ? $_POST['wc_to_post_comment_text'] : 'to post a comment';
154
+ $this->wc_options_serialize->wc_phrases['wc_vote_counted'] = isset($_POST['wc_vote_counted']) ? $_POST['wc_vote_counted'] : 'Vote Counted';
155
+ $this->wc_options_serialize->wc_phrases['wc_vote_up'] = isset($_POST['wc_vote_up']) ? $_POST['wc_vote_up'] : 'Vote Up';
156
+ $this->wc_options_serialize->wc_phrases['wc_vote_down'] = isset($_POST['wc_vote_down']) ? $_POST['wc_vote_down'] : 'Vote Down';
157
+ $this->wc_options_serialize->wc_phrases['wc_held_for_moderate'] = isset($_POST['wc_held_for_moderate']) ? $_POST['wc_held_for_moderate'] : 'Your Comment waiting moderation';
158
+ $this->wc_options_serialize->wc_phrases['wc_vote_only_one_time'] = isset($_POST['wc_vote_only_one_time']) ? $_POST['wc_vote_only_one_time'] : 'You\'ve already voted for this comment';
159
+ $this->wc_options_serialize->wc_phrases['wc_voting_error'] = isset($_POST['wc_voting_error']) ? $_POST['wc_voting_error'] : 'Voting Error';
160
+ $this->wc_options_serialize->wc_phrases['wc_self_vote'] = isset($_POST['wc_self_vote']) ? $_POST['wc_self_vote'] : 'You cannot vote for your comment';
161
+ $this->wc_options_serialize->wc_phrases['wc_login_to_vote'] = isset($_POST['wc_login_to_vote']) ? $_POST['wc_login_to_vote'] : 'You Must Be Logged In To Vote';
162
+ $this->wc_options_serialize->wc_phrases['wc_invalid_captcha'] = isset($_POST['wc_invalid_captcha']) ? $_POST['wc_invalid_captcha'] : 'Invalid Captcha Code';
163
+ $this->wc_options_serialize->wc_phrases['wc_invalid_field'] = isset($_POST['wc_invalid_field']) ? $_POST['wc_invalid_field'] : 'Some of field value is invalid';
164
+
165
+ $this->wc_db_helper->update_phrases($this->wc_options_serialize->wc_phrases);
166
+ }
167
+ if ($this->wc_db_helper->is_phrase_exists('wc_discuss_tab')) {
168
+ $this->wc_options_serialize->wc_phrases = $this->wc_db_helper->get_phrases();
169
+ }
170
+ ?>
171
+ <div class="wrap wpdiscuz_options_page">
172
+
173
+ <div style="float:left; width:50px; height:55px; margin:10px 10px 20px 0px;">
174
+ <img src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/plugin-icon/plugin-icon-48.png'); ?>" style="height:43px;"/>
175
+ </div>
176
+ <h2 style="padding-bottom:20px; padding-top:15px;"><?php _e('WpDiscuz Front-end Phrases', 'wpdiscuz'); ?></h2>
177
+ <br style="clear:both" />
178
+ <form action="<?php echo $_SERVER['PHP_SELF']; ?>?page=wpdiscuz_phrases_page&updated=true" method="post" name="wpdiscuz_phrases_page" class="wc-phrases-settings-form wc-form">
179
+ <?php
180
+ if (function_exists('wp_nonce_field')) {
181
+ wp_nonce_field('wc_phrases_form');
182
+ }
183
+ ?>
184
+ <table cellspacing="0" class="wp-list-table widefat plugins">
185
+ <thead>
186
+ <tr>
187
+ <th colspan="4" scope="col">&nbsp;</th>
188
+ </tr>
189
+ </thead>
190
+ <tfoot>
191
+ <tr>
192
+ <th colspan="4">&nbsp;</th>
193
+ </tr>
194
+ </tfoot>
195
+ <tbody>
196
+ <?php include 'options-templates/options-template-phrases.php'; ?>
197
+
198
+ <tr valign="top">
199
+ <td colspan="4">
200
+ <p class="submit">
201
+ <input type="submit" class="button button-primary" name="submit_phrases" value="<?php _e('Save Changes', 'wpdiscuz'); ?>" />
202
+ </p>
203
+ </td>
204
+ </tr>
205
+
206
+ <input type="hidden" name="action" value="update" />
207
+ </tbody>
208
+ </table>
209
+ </form>
210
+
211
+ </div>
212
+ <?php
213
+ }
214
+
215
+ }
216
+ ?>
wc.php ADDED
@@ -0,0 +1,449 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ Plugin Name: WpDiscuz
5
+ Description: Better comment system. Wordpress post comments and discussion plugin. Allows your visitors discuss, vote for comments and share.
6
+ Version: 1.0.0
7
+ Author: gVectors Team (A. Chakhoyan, G. Zakaryan, H. Martirosyan)
8
+ Author URI: http://www.gvectors.com/
9
+ Plugin URI: http://www.gvectors.com/
10
+ */
11
+
12
+ include_once 'wc-options.php';
13
+ include_once 'helper/wc-helper.php';
14
+ include_once 'includes/wc-db-helper.php';
15
+ include_once 'comment-form/tpl-comment.php';
16
+ include_once 'dto/wc-comment.php';
17
+ include_once 'wc-css.php';
18
+
19
+ class WC_Core {
20
+
21
+ public $wc_options;
22
+ public $comment_types;
23
+ public $reviews_count;
24
+ public $wc_db_helper;
25
+ public $wc_helper;
26
+ public $comment_tpl_builder;
27
+ public $wc_css;
28
+ public $wc_parent_comments_count;
29
+ public $commetns_count = 0;
30
+ public $comment_count_text;
31
+ public static $PLUGIN_DIRECTORY;
32
+ public $post_type;
33
+
34
+ function __construct() {
35
+ add_action('init', array(&$this, 'init_plugin_dir_name'), 1);
36
+
37
+ $this->wc_options = new WC_Options();
38
+ $this->wc_db_helper = $this->wc_options->wc_db_helper;
39
+
40
+ register_activation_hook(__FILE__, array($this, 'db_operations'));
41
+
42
+
43
+ $this->wc_helper = new WC_Helper($this->wc_options->wc_options_serialize);
44
+ $this->wc_css = new WC_CSS($this->wc_options);
45
+ $this->comment_tpl_builder = new WC_Comment_Template_Builder($this->wc_helper, $this->wc_db_helper, $this->wc_options);
46
+
47
+ add_action('init', array(&$this, 'register_session'), 2);
48
+
49
+ add_action('admin_enqueue_scripts', array(&$this, 'admin_page_styles_scripts'), 2315);
50
+ add_action('wp_enqueue_scripts', array(&$this, 'front_end_styles_scripts'));
51
+ add_action('wp_enqueue_scripts', array(&$this->wc_css, 'init_styles'));
52
+
53
+ add_action('admin_menu', array(&$this, 'add_plugin_options_page'), -191);
54
+
55
+ add_action('wp_ajax_wc_comms_via_ajax', array(&$this, 'comment_submit_via_ajax'));
56
+ add_action('wp_ajax_nopriv_wc_comms_via_ajax', array(&$this, 'comment_submit_via_ajax'));
57
+
58
+ add_action('wp_ajax_wc_load_more_comments', array(&$this, 'load_more_comments'));
59
+ add_action('wp_ajax_nopriv_wc_load_more_comments', array(&$this, 'load_more_comments'));
60
+
61
+ add_action('wp_ajax_wc_vote_via_ajax', array(&$this, 'vote_on_comment'));
62
+ add_action('wp_ajax_nopriv_wc_vote_via_ajax', array(&$this, 'vote_on_comment'));
63
+
64
+ add_action('wp_ajax_email_notification', array(&$this, 'email_notification'));
65
+ add_action('wp_ajax_nopriv_email_notification', array(&$this, 'email_notification'));
66
+ add_filter('preprocess_comment', array(&$this, 'wc_new_comment'));
67
+
68
+ add_action('wp_head', array(&$this, 'init_current_post_type'));
69
+ }
70
+
71
+ /**
72
+ * create table
73
+ * updates the comments to set comment type review if comment id is exists in comment meta table
74
+ */
75
+ public function db_operations() {
76
+ $this->wc_db_helper->create_tables();
77
+ }
78
+
79
+ /*
80
+ * register new session
81
+ */
82
+
83
+ public function register_session() {
84
+ if (!session_id()) {
85
+ @session_start();
86
+ }
87
+ }
88
+
89
+ /**
90
+ * change comment type
91
+ */
92
+ public function wc_new_comment($commentdata) {
93
+
94
+ $commentdata['comment_type'] = isset($commentdata['comment_type']) ? $commentdata['comment_type'] : '';
95
+ $comment_post = get_post($commentdata['comment_post_ID']);
96
+ if ($comment_post->post_type === 'product' && $commentdata['comment_type'] != 'wpdiscuz') {
97
+ $com_parent = $commentdata['comment_parent'];
98
+ if ($com_parent != 0) {
99
+ $parent_comment = get_comment($com_parent);
100
+ if ($parent_comment->comment_type == 'wpdiscuz') {
101
+ $commentdata['comment_type'] = 'wpdiscuz';
102
+ } else {
103
+ $commentdata['comment_type'] = 'wpdiscuz_review';
104
+ }
105
+ } else {
106
+ $commentdata['comment_type'] = 'wpdiscuz_review';
107
+ }
108
+ }
109
+
110
+ return $commentdata;
111
+ }
112
+
113
+ /**
114
+ * register options page for plugin
115
+ */
116
+ public function add_plugin_options_page() {
117
+ if (function_exists('add_options_page')) {
118
+ add_menu_page('WpDiscuz', 'WpDiscuz', 'manage_options', 'wpdiscuz_options_page', array(&$this->wc_options, 'main_options_form'), plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/plugin-icon/plugin-icon-20.png'), 1246);
119
+ add_submenu_page('wpdiscuz_options_page', 'Phrases', 'Phrases', 'manage_options', 'wpdiscuz_phrases_page', array(&$this->wc_options, 'phrases_options_form'));
120
+ }
121
+ }
122
+
123
+ /**
124
+ * Styles and scripts registration to use on front page
125
+ */
126
+ public function front_end_styles_scripts() {
127
+
128
+
129
+ $u_agent = $_SERVER['HTTP_USER_AGENT'];
130
+
131
+ if (preg_match('/MSIE/i', $u_agent)) {
132
+ wp_enqueue_script('wc-html5-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/tooltipster/js/html5.js'), array('jquery'), '1.2', false);
133
+
134
+ wp_register_style('modal-css-ie', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/modal-box/modal-box-ie.css'));
135
+ wp_enqueue_style('modal-css-ie');
136
+ }
137
+
138
+ wp_register_style('modal-box-css', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/modal-box/modal-box.css'));
139
+ wp_enqueue_style('modal-box-css');
140
+
141
+ wp_enqueue_script('form-validator-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/js/validator.js'), array('jquery'), '1.0.0', false);
142
+
143
+ wp_register_style('validator-style', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/css/fv.css'));
144
+ wp_enqueue_style('validator-style');
145
+
146
+ wp_enqueue_script('wc-ajax-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/js/wc-ajax.js'), array('jquery'), '1.0.0', false);
147
+ wp_localize_script('wc-ajax-js', 'wc_ajax_obj', array('url' => admin_url('admin-ajax.php')));
148
+
149
+ wp_enqueue_script('wc-cookie-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/js/jquery.cookie.js'), array('jquery'), '1.4.1', false);
150
+
151
+ wp_register_style('wc-tooltipster-style', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/tooltipster/css/tooltipster.css'));
152
+ wp_enqueue_style('wc-tooltipster-style');
153
+
154
+ wp_enqueue_script('wc-tooltipster-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/tooltipster/js/jquery.tooltipster.min.js'), array('jquery'), '1.2', false);
155
+
156
+ wp_enqueue_script('autogrowtextarea-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/js/jquery.autogrowtextarea.min.js'), array('jquery'), '3.0', false);
157
+ }
158
+
159
+ /**
160
+ * Scripts and styles registration on administration pages
161
+ */
162
+ public function admin_page_styles_scripts() {
163
+
164
+ $u_agent = $_SERVER['HTTP_USER_AGENT'];
165
+ if (preg_match('/MSIE/i', $u_agent)) {
166
+ wp_register_style('modal-css-ie', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/modal-box/modal-box-ie.css'));
167
+ wp_enqueue_style('modal-css-ie');
168
+ }
169
+
170
+ wp_register_style('modal-box-css', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/modal-box/modal-box.css'));
171
+ wp_enqueue_style('modal-box-css');
172
+
173
+ wp_register_style('colorpicker-css', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/colorpicker/css/colorpicker.css'));
174
+ wp_enqueue_style('colorpicker-css');
175
+
176
+ wp_register_script('wc-colorpicker-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/third-party/colorpicker/js/colorpicker.js'), array('jquery'), '2.0.0.9', false);
177
+ wp_enqueue_script('wc-colorpicker-js');
178
+
179
+ wp_register_style('wc-options-css', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/css/options-css.css'));
180
+ wp_enqueue_style('wc-options-css');
181
+
182
+ wp_register_script('wc-option-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/js/options-js.js'), array('jquery'));
183
+ wp_enqueue_script('wc-option-js');
184
+
185
+ wp_register_script('wc-scripts-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/js/wc-scripts.js'), array('jquery'));
186
+ wp_enqueue_script('wc-scripts-js');
187
+ }
188
+
189
+ /*
190
+ * post comment via ajax
191
+ */
192
+
193
+ public function comment_submit_via_ajax() {
194
+
195
+ $message_array = array();
196
+ $comment_post_ID = intval(filter_input(INPUT_POST, 'comment_post_ID'));
197
+ $comment_parent = intval(filter_input(INPUT_POST, 'comment_parent'));
198
+ if (!$this->wc_options->wc_options_serialize->wc_captcha_show_hide) {
199
+ if (!is_user_logged_in()) {
200
+ $sess_captcha = $_SESSION['wc_captcha'][$comment_post_ID . '-' . $comment_parent];
201
+ $captcha = filter_input(INPUT_POST, 'captcha');
202
+ if (md5(strtolower($captcha)) !== $sess_captcha) {
203
+ $message_array['code'] = -1;
204
+ $message_array['message'] = $this->wc_options->wc_options_serialize->wc_phrases['wc_invalid_captcha'];
205
+ echo json_encode($message_array);
206
+ exit;
207
+ }
208
+ }
209
+ }
210
+ $comment = filter_input(INPUT_POST, 'comment');
211
+
212
+ if (is_user_logged_in()) {
213
+ $user_id = get_current_user_id();
214
+ $user = get_userdata($user_id);
215
+ $name = $user->display_name;
216
+ $email = $user->user_email;
217
+ $user_url = $user->user_url;
218
+ } else {
219
+ $name = filter_input(INPUT_POST, 'name');
220
+ $email = filter_input(INPUT_POST, 'email');
221
+ $user_id = 0;
222
+ $user_url = '';
223
+ }
224
+
225
+ $comment = preg_replace('|[\n]+|', '<br />', wp_kses($comment, 'default'));
226
+
227
+ if ($name && filter_var($email, FILTER_VALIDATE_EMAIL) && $comment && filter_var($comment_post_ID)) {
228
+
229
+ $held_moderate = 1;
230
+ if ($this->wc_options->wc_options_serialize->wc_held_comment_to_moderate) {
231
+ $held_moderate = 0;
232
+ }
233
+
234
+ $new_commentdata = array(
235
+ 'user_id' => $user_id,
236
+ 'comment_post_ID' => $comment_post_ID,
237
+ 'comment_parent' => $comment_parent,
238
+ 'comment_author' => $name,
239
+ 'comment_author_email' => $email,
240
+ 'comment_content' => $comment,
241
+ 'comment_author_url' => $user_url,
242
+ 'comment_approved' => $held_moderate
243
+ );
244
+ if (!$held_moderate) {
245
+ $new_comment_id = wp_new_comment($new_commentdata);
246
+ $new_inserted_comment = get_comment($new_comment_id);
247
+ if ($new_inserted_comment->comment_approved) {
248
+ $held_moderate = 1;
249
+ }
250
+ } else {
251
+ $new_comment_id = wp_insert_comment($new_commentdata);
252
+ }
253
+ $new_comment = new WC_Comment(get_comment($new_comment_id, OBJECT));
254
+
255
+ if (!$held_moderate) {
256
+ $message_array['code'] = -2;
257
+ $message_array['message'] = $this->wc_options->wc_options_serialize->wc_phrases['wc_held_for_moderate'];
258
+ } else {
259
+ $message_array['code'] = 1;
260
+ $message_array['message'] = $this->comment_tpl_builder->get_comment_template($new_comment);
261
+ }
262
+ $message_array['wc_new_comment_id'] = $new_comment_id;
263
+ } else {
264
+ $message_array['code'] = -1;
265
+ $message_array['wc_new_comment_id'] = -1;
266
+ $message_array['message'] = $this->wc_options->wc_options_serialize->wc_phrases['wc_invalid_field'];
267
+ }
268
+ echo json_encode($message_array);
269
+ exit;
270
+ }
271
+
272
+ /**
273
+ * notify on new comments
274
+ */
275
+ public function email_notification() {
276
+
277
+ $wc_new_comment_id = isset($_POST['wc_new_comment_id']) ? intval($_POST['wc_new_comment_id']) : -1;
278
+ $wc_comment_parent = isset($_POST['wc_comment_parent']) ? intval($_POST['wc_comment_parent']) : -1;
279
+ if ($wc_new_comment_id !== -1 && $wc_comment_parent !== -1) {
280
+ if ($this->wc_options->wc_options_serialize->wc_notify_moderator) {
281
+ wp_notify_postauthor($wc_new_comment_id);
282
+ }
283
+ if ($this->wc_options->wc_options_serialize->wc_notify_comment_author && $wc_comment_parent) {
284
+ $wc_new_comment_content = get_comment($wc_new_comment_id)->comment_content;
285
+ $comment = get_comment($wc_comment_parent);
286
+ $to = $comment->comment_author_email;
287
+ $subject = $this->wc_options->wc_options_serialize->wc_phrases['wc_email_subject'];
288
+ $permalink = get_comment_link($wc_comment_parent);
289
+ $message = $this->wc_options->wc_options_serialize->wc_phrases['wc_email_message'];
290
+ $message .= "<br/><br/><a href='$permalink'>$permalink</a>";
291
+ $message .= "<br/><br/>$wc_new_comment_content";
292
+ $headers = array();
293
+ $headers[] = "Content-Type: text/html; charset=UTF-8";
294
+ $headers[] = "From: " . get_bloginfo('name') . "\r\n";
295
+ wp_mail($to, $subject, $message, $headers);
296
+ }
297
+ }
298
+ }
299
+
300
+ /**
301
+ * vote on comment via ajax
302
+ */
303
+ public function vote_on_comment() {
304
+ $messageArray = array();
305
+ $messageArray['code'] = -1;
306
+ $comment_id = '';
307
+ if (!is_user_logged_in()) {
308
+ $messageArray['message'] = $this->wc_options->wc_options_serialize->wc_phrases['wc_login_to_vote'];
309
+ echo json_encode($messageArray);
310
+ exit();
311
+ }
312
+ if (isset($_POST['comment_ID']) && isset($_POST['vote_type']) && intval($_POST['comment_ID']) && intval($_POST['vote_type'])) {
313
+ $comment_id = $_POST['comment_ID'];
314
+ $user_id = get_current_user_id();
315
+ $vote_type = $_POST['vote_type'];
316
+
317
+ $is_user_voted = $this->wc_db_helper->is_user_voted($user_id, $comment_id);
318
+ $comment = get_comment($comment_id);
319
+ if ($comment->user_id == $user_id) {
320
+ $messageArray['message'] = $this->wc_options->wc_options_serialize->wc_phrases['wc_self_vote'];
321
+ echo json_encode($messageArray);
322
+ exit();
323
+ }
324
+
325
+ if ($is_user_voted != '') {
326
+ $vote = intval($is_user_voted) + intval($vote_type);
327
+ if ($vote >= -1 && $vote <= 1) {
328
+ $this->wc_db_helper->update_vote_type($user_id, $comment_id, $vote);
329
+ $vote_count = intval(get_comment_meta($comment_id, 'wpdiscuz_votes', true)) + intval($vote_type);
330
+ update_comment_meta($comment_id, 'wpdiscuz_votes', '' . $vote_count);
331
+ $messageArray['code'] = 1;
332
+ $messageArray['message'] = $this->wc_options->wc_options_serialize->wc_phrases['wc_vote_counted'];
333
+ } else {
334
+ $messageArray['message'] = $this->wc_options->wc_options_serialize->wc_phrases['wc_vote_only_one_time'];
335
+ }
336
+ } else {
337
+ $this->wc_db_helper->add_vote_type($user_id, $comment_id, $vote_type);
338
+ $vote_count = get_comment_meta($comment_id, 'wpdiscuz_votes', true);
339
+ if ($vote_count == '') {
340
+ add_comment_meta($comment_id, 'wpdiscuz_votes', '' . $vote_type);
341
+ } else {
342
+ $vote_count = intval($vote_count) + intval($vote_type);
343
+ update_comment_meta($comment_id, 'wpdiscuz_votes', '' . $vote_count);
344
+ }
345
+ $messageArray['code'] = 1;
346
+ $messageArray['message'] = $this->wc_options->wc_options_serialize->wc_phrases['wc_vote_counted'];
347
+ }
348
+ } else {
349
+ $messageArray['message'] = $this->wc_options->wc_options_serialize->wc_phrases['wc_voting_error'];
350
+ }
351
+
352
+ echo json_encode($messageArray);
353
+ exit();
354
+ }
355
+
356
+ /**
357
+ * get comments by comment type
358
+ */
359
+ public function get_wp_comments($comments_offset, $post_id = null) {
360
+ global $post;
361
+
362
+ if (!$post_id) {
363
+ $post_id = $post->ID;
364
+ }
365
+ $wc_comment_count = $this->wc_options->wc_options_serialize->wc_comment_count;
366
+
367
+ $comm_list_args = array(
368
+ 'callback' => array(&$this, 'wc_comment_callback'),
369
+ 'style' => 'div',
370
+ 'per_page' => $comments_offset * $wc_comment_count,
371
+ 'max_depth' => 2
372
+ );
373
+
374
+ $comments = get_comments(
375
+ array('post_id' => $post_id, 'status' => 'approve')
376
+ );
377
+
378
+ $wc_comments = $this->init_wc_comments($comments);
379
+ wp_list_comments($comm_list_args, $wc_comments);
380
+ return $this->wc_parent_comments_count;
381
+ }
382
+
383
+ /**
384
+ * load more comments by offset
385
+ */
386
+ public function load_more_comments() {
387
+ $c_offset = intval($_POST['comments_offset']);
388
+ $c_offset = ($c_offset) ? $c_offset : 1;
389
+ $post_id = intval($_POST['wc_post_id']);
390
+ if ($c_offset && $post_id) {
391
+ $this->get_wp_comments($c_offset, $post_id);
392
+ }
393
+ exit();
394
+ }
395
+
396
+ /**
397
+ * initialize WPC comments
398
+ */
399
+ public function init_wc_comments($comments) {
400
+ $wc_comments = array();
401
+ if ($comments) {
402
+ foreach ($comments as $comment) {
403
+ if (!$comment->comment_parent) {
404
+ $this->wc_parent_comments_count++;
405
+ }
406
+ $wc_comments[] = new WC_Comment($comment);
407
+ }
408
+ }
409
+ return $wc_comments;
410
+ }
411
+
412
+ public function wc_comment_callback($comment, $args, $depth) {
413
+ $GLOBALS['comment'] = $comment;
414
+ echo $this->comment_tpl_builder->get_comment_template($comment);
415
+ }
416
+
417
+ public function is_guest_can_comment() {
418
+ $user_can_comment = TRUE;
419
+ if ($this->wc_options->wc_options_serialize->wc_user_must_be_registered) {
420
+ if (!is_user_logged_in()) {
421
+ $user_can_comment = FALSE;
422
+ }
423
+ }
424
+ return $user_can_comment;
425
+ }
426
+
427
+ public function init_plugin_dir_name() {
428
+ $plugin_dir_path = plugin_dir_path(__FILE__);
429
+ $path_array = array_values(array_filter(explode(DIRECTORY_SEPARATOR, $plugin_dir_path)));
430
+ $path_last_part = $path_array[count($path_array) - 1];
431
+ WC_Core::$PLUGIN_DIRECTORY = untrailingslashit($path_last_part);
432
+ }
433
+
434
+ public function init_current_post_type() {
435
+ global $post;
436
+ if (in_array($post->post_type, $this->wc_options->wc_options_serialize->wc_post_types) && comments_open($post->ID)) {
437
+ add_filter('comments_template', array(&$this, 'remove_comments_template_on_pages'), 1);
438
+ }
439
+ }
440
+
441
+ function remove_comments_template_on_pages($file) {
442
+ $file = dirname(__FILE__) . '/comment-form/form.php';
443
+ return $file;
444
+ }
445
+
446
+ }
447
+
448
+ $wc_core = new WC_Core();
449
+ ?>