Comments – wpDiscuz - Version 5.0.5

Version Description

Download this release

Release Info

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

Code changes from version 5.0.4 to 5.0.5

assets/css/options.css CHANGED
@@ -1,4 +1,3 @@
1
-
2
  .wc-form table.wp-list-table td, .wc-form table.wp-list-table th{ padding: 12px 5px;}
3
  .wc-form tr:nth-child(even){background:#fff}.wc-form tr:nth-child(odd){background:#f9f9f9}.form-table.wc-form-table tr{background:transparent}.wpdiscuz_options_page .wc-phrases-settings-form input[type="text"],.wpdiscuz_options_page .wc-phrases-settings-form textarea{width:300px}.wpdiscuz_wrap { height: 50px;width: 100%;}.wpdiscuz_progressbar {height: 50px;text-align: center;background: #f00;width: 0;}
4
  .wpdiscuz-share-buttons {display: inline-block; width: 18px; height: 18px;}
@@ -43,7 +42,7 @@
43
  .wpdiscuz_options_page .widefat a:hover{color:#10b493;}
44
 
45
  /*addons*/
46
- #menu-comments ul > li:nth-child(3) a{ color:#25ACEA!important; text-shadow: 1px 1px 1px #000; }
47
  .wpdiscuz_addons_page .wpdiscuz-addons-wrapper {box-sizing: border-box;}
48
  .wpdiscuz_addons_page .wpdiscuz-addon-block {width: 260px; padding-top:10px; height:auto; float: left; margin-right: 1%; margin-bottom: 20px; background: #fff; border: 2px solid #e5e5e5; box-shadow: 0 3px 3px rgba(0, 0, 0, 0.04);}
49
  .wpdiscuz_addons_page .wpdiscuz-addon-block .addon-thumb {float:none; width: 242px; padding:10px; margin-top:2px; height:180px;}
@@ -55,19 +54,21 @@
55
  .wpdiscuz_addons_page .wpdiscuz-addon-block .addon-button{ margin-bottom:10px;}
56
  .wpdiscuz_addons_page .wpdiscuz-addon-block .note-installed { padding:10px 20px; background:#fff; border: 1px solid #ddd; box-shadow: 0 3px 3px rgba(0, 0, 0, 0.04); color:#07B290; font-size:14px; margin-top:20px; }
57
 
58
- .wpdiscuz-rating { border: none; float: left;}
59
- .wpdiscuz-rating > input { display: none; }
60
- .wpdiscuz-rating > label:before { margin: 5px; font-size: 1.25em; }
61
- .wpdiscuz-rating > .half:before { position: absolute; }
62
- .wpdiscuz-rating > label { color: #ddd; float: right; }
 
 
63
 
64
- /***** CSS Magic to Highlight Stars on Hover *****/
 
 
65
 
66
- .wpdiscuz-rating > input:checked ~ label, /* show gold star when clicked */
67
- .wpdiscuz-rating:not(:checked) > label:hover, /* hover current star */
68
- .wpdiscuz-rating:not(:checked) > label:hover ~ label { color: #FFD700; } /* hover previous stars in list */
 
69
 
70
- .wpdiscuz-rating > input:checked + label:hover, /* hover current star when changing rating */
71
- .wpdiscuz-rating > input:checked ~ label:hover,
72
- .wpdiscuz-rating > label:hover ~ input:checked ~ label, /* lighten current selection */
73
- .wpdiscuz-rating > input:checked ~ label:hover ~ label { color: #FFED85; }
 
1
  .wc-form table.wp-list-table td, .wc-form table.wp-list-table th{ padding: 12px 5px;}
2
  .wc-form tr:nth-child(even){background:#fff}.wc-form tr:nth-child(odd){background:#f9f9f9}.form-table.wc-form-table tr{background:transparent}.wpdiscuz_options_page .wc-phrases-settings-form input[type="text"],.wpdiscuz_options_page .wc-phrases-settings-form textarea{width:300px}.wpdiscuz_wrap { height: 50px;width: 100%;}.wpdiscuz_progressbar {height: 50px;text-align: center;background: #f00;width: 0;}
3
  .wpdiscuz-share-buttons {display: inline-block; width: 18px; height: 18px;}
42
  .wpdiscuz_options_page .widefat a:hover{color:#10b493;}
43
 
44
  /*addons*/
45
+ #menu-comments ul > li:nth-child(3) a{ color:#25ACEA!important; text-shadow: 1px 1px 1px #000; }
46
  .wpdiscuz_addons_page .wpdiscuz-addons-wrapper {box-sizing: border-box;}
47
  .wpdiscuz_addons_page .wpdiscuz-addon-block {width: 260px; padding-top:10px; height:auto; float: left; margin-right: 1%; margin-bottom: 20px; background: #fff; border: 2px solid #e5e5e5; box-shadow: 0 3px 3px rgba(0, 0, 0, 0.04);}
48
  .wpdiscuz_addons_page .wpdiscuz-addon-block .addon-thumb {float:none; width: 242px; padding:10px; margin-top:2px; height:180px;}
54
  .wpdiscuz_addons_page .wpdiscuz-addon-block .addon-button{ margin-bottom:10px;}
55
  .wpdiscuz_addons_page .wpdiscuz-addon-block .note-installed { padding:10px 20px; background:#fff; border: 1px solid #ddd; box-shadow: 0 3px 3px rgba(0, 0, 0, 0.04); color:#07B290; font-size:14px; margin-top:20px; }
56
 
57
+ .wpdiscuz-rating { border: none; float: left;}
58
+ .wpdiscuz-rating > input { display: none; }
59
+ .wpdiscuz-rating > label:before { margin: 5px; font-size: 1.25em; }
60
+ .wpdiscuz-rating > .half:before { position: absolute; }
61
+ .wpdiscuz-rating > label { color: #ddd; float: right; }
62
+
63
+ /***** CSS Magic to Highlight Stars on Hover *****/
64
 
65
+ .wpdiscuz-rating > input:checked ~ label, /* show gold star when clicked */
66
+ .wpdiscuz-rating:not(:checked) > label:hover, /* hover current star */
67
+ .wpdiscuz-rating:not(:checked) > label:hover ~ label { color: #FFD700; } /* hover previous stars in list */
68
 
69
+ .wpdiscuz-rating > input:checked + label:hover, /* hover current star when changing rating */
70
+ .wpdiscuz-rating > input:checked ~ label:hover,
71
+ .wpdiscuz-rating > label:hover ~ input:checked ~ label, /* lighten current selection */
72
+ .wpdiscuz-rating > input:checked ~ label:hover ~ label { color: #FFED85; }
73
 
74
+ .import-percentage {vertical-align: middle;color: #444;margin-left: 5px;}
 
 
 
assets/js/wpdiscuz-options.js CHANGED
@@ -6,7 +6,7 @@ jQuery(document).ready(function ($) {
6
  $('#wpdiscuz-addons-options').remove();
7
  }
8
  }
9
-
10
  $('#wc_share_button_fb').click(function () {
11
  if ($(this).is(':checked')) {
12
  $('#wpc-fb-api-cont').attr('style', '');
@@ -104,6 +104,52 @@ jQuery(document).ready(function ($) {
104
  return false;
105
  });
106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  $('#wpd-disable-addons').click(function () {
108
  location.href = $('#wpd-disable-addons-action').val();
109
  });
6
  $('#wpdiscuz-addons-options').remove();
7
  }
8
  }
9
+
10
  $('#wc_share_button_fb').click(function () {
11
  if ($(this).is(':checked')) {
12
  $('#wpc-fb-api-cont').attr('style', '');
104
  return false;
105
  });
106
 
107
+ $(document).delegate('.import-stcr', 'click', function (e) {
108
+ e.preventDefault();
109
+ var btn = $(this);
110
+ btn.attr('disabled', 'disabled');
111
+ $('.fas', btn).addClass('fa-pulse fa-spinner').removeClass('wc-hidden');
112
+ importSTCR(btn);
113
+
114
+ });
115
+
116
+ function importSTCR(btn) {
117
+ var data = btn.parents('.wc-form').serialize();
118
+ $.ajax({
119
+ type: 'POST',
120
+ url: ajaxurl,
121
+ data: {stcrData: data, 'action': 'wpdImportSTCR'}
122
+ }).done(function (response) {
123
+ try {
124
+ var resp = $.parseJSON(response);
125
+ console.log(resp.progress);
126
+ $('.stcr-step').val(resp.step);
127
+
128
+ if (resp.progress < 100) {
129
+ importSTCR(btn);
130
+ } else {
131
+ btn.removeAttr('disabled');
132
+ $('.fas', btn).removeClass('fa-pulse fa-spinner').addClass('wc-hidden');
133
+ }
134
+
135
+
136
+ if (resp.progress <= 3) {
137
+ $('.import-progress').text(3 + '%');
138
+ } else {
139
+ if (resp.progress < 100) {
140
+ $('.import-progress').text(resp.progress + '%');
141
+ } else {
142
+ $('.import-progress').css({'color': '#10b493'});
143
+ $('.import-progress').text(resp.progress + '% Done');
144
+ }
145
+ }
146
+
147
+ } catch (e) {
148
+ console.log(e);
149
+ }
150
+ });
151
+ }
152
+
153
  $('#wpd-disable-addons').click(function () {
154
  location.href = $('#wpd-disable-addons-action').val();
155
  });
assets/js/wpdiscuz.js CHANGED
@@ -222,6 +222,7 @@ jQuery(document).ready(function ($) {
222
  $(currentSubmitBtn).removeClass('wc_not_clicked');
223
  var data = new FormData();
224
  data.append('action', 'addComment');
 
225
  var inputs = $(":input", wcForm);
226
  inputs.each(function () {
227
  if (this.name != '' && this.type != 'checkbox' && this.type != 'radio') {
@@ -348,7 +349,7 @@ jQuery(document).ready(function ($) {
348
  console.log(obj.callbackFunctions[i] + " is not a function");
349
  }
350
  });
351
- }
352
  } catch (e) {
353
  if (response.indexOf('<') >= 0 && response.indexOf('>') >= 0) {
354
  message = e;
222
  $(currentSubmitBtn).removeClass('wc_not_clicked');
223
  var data = new FormData();
224
  data.append('action', 'addComment');
225
+ data.append('antispamKey', wpdiscuzAjaxObj.wpdiscuz_options.antispamKey);
226
  var inputs = $(":input", wcForm);
227
  inputs.each(function () {
228
  if (this.name != '' && this.type != 'checkbox' && this.type != 'radio') {
349
  console.log(obj.callbackFunctions[i] + " is not a function");
350
  }
351
  });
352
+ }
353
  } catch (e) {
354
  if (response.indexOf('<') >= 0 && response.indexOf('>') >= 0) {
355
  message = e;
class.WpdiscuzCore.php CHANGED
@@ -3,7 +3,7 @@
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: 5.0.4
7
  * Author: gVectors Team (A. Chakhoyan, G. Zakaryan, H. Martirosyan)
8
  * Author URI: https://gvectors.com/
9
  * Plugin URI: http://wpdiscuz.com/
@@ -344,6 +344,12 @@ class WpdiscuzCore implements WpDiscuzConstants {
344
  $isAnonymous = false;
345
  $uniqueId = isset($_POST['wpdiscuz_unique_id']) ? trim($_POST['wpdiscuz_unique_id']) : '';
346
  $postId = isset($_POST['postId']) ? intval($_POST['postId']) : '';
 
 
 
 
 
 
347
  if ($uniqueId && $postId) {
348
  $form = $this->wpdiscuzForm->getForm($postId);
349
  $form->initFormFields();
@@ -376,7 +382,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
376
  $user_id = 0;
377
  $name = $form->validateDefaultName($currentUser);
378
  $email = $form->validateDefaultEmail($currentUser, $isAnonymous);
379
- $website_url = $form->validateDefaultWebsit($currentUser);
380
  }
381
 
382
  $comment_content = $this->helper->replaceCommentContentCode(trim($_POST['wc_comment']));
@@ -460,7 +466,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
460
  $commentListArgs['comment_author_email'] = $email;
461
  $this->form = $this->wpdiscuzForm->getForm($postId);
462
  $commentListArgs['can_user_comment'] = $this->form ? $this->form->isUserCanComment($currentUser, $postId) : true;
463
- $messageArray['message'] = wp_list_comments($commentListArgs, array($newComment));
464
  } else {
465
  $messageArray['code'] = 'wc_invalid_field';
466
  }
@@ -1191,19 +1197,17 @@ class WpdiscuzCore implements WpDiscuzConstants {
1191
  }
1192
 
1193
  public function pluginNewVersion() {
1194
- $this->dbManager->createEmailNotificationTable();
1195
- $this->dbManager->createAvatarsCacheTable();
1196
  $pluginData = get_plugin_data(__FILE__);
1197
  if (version_compare($pluginData['Version'], $this->version, '>')) {
 
 
 
1198
  $this->wpdiscuzForm->createDefaultForm($this->version);
1199
  $options = $this->changeOldOptions(get_option(self::OPTION_SLUG_OPTIONS), $pluginData);
1200
  $this->addNewOptions($options);
1201
  $this->addNewPhrases();
1202
- if ($this->version === '1.0.0') {
1203
- add_option(self::OPTION_SLUG_VERSION, $pluginData['Version']);
1204
- } else {
1205
- update_option(self::OPTION_SLUG_VERSION, $pluginData['Version']);
1206
- }
1207
  if (version_compare($this->version, '2.1.2', '<=') && version_compare($this->version, '1.0.0', '!=')) {
1208
  $this->dbManager->alterPhrasesTable();
1209
  }
@@ -1212,9 +1216,8 @@ class WpdiscuzCore implements WpDiscuzConstants {
1212
  $this->dbManager->alterVotingTable();
1213
  }
1214
 
1215
- if (version_compare($this->version, '3.0.0', '<=') && version_compare($this->version, '1.0.0', '!=')) {
1216
- $this->dbManager->alterNotificationTable();
1217
- }
1218
  }
1219
  do_action('wpdiscuz_check_version');
1220
  }
@@ -1315,7 +1318,8 @@ class WpdiscuzCore implements WpDiscuzConstants {
1315
  'comment_status' => array(1),
1316
  'voting_icons' => $likeIcons,
1317
  'comments_open' => comments_open($post->ID),
1318
- 'high_level_user' => current_user_can('moderate_comments')
 
1319
  );
1320
  return apply_filters('wpdiscuz_comment_list_args', $args);
1321
  }
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: 5.0.5
7
  * Author: gVectors Team (A. Chakhoyan, G. Zakaryan, H. Martirosyan)
8
  * Author URI: https://gvectors.com/
9
  * Plugin URI: http://wpdiscuz.com/
344
  $isAnonymous = false;
345
  $uniqueId = isset($_POST['wpdiscuz_unique_id']) ? trim($_POST['wpdiscuz_unique_id']) : '';
346
  $postId = isset($_POST['postId']) ? intval($_POST['postId']) : '';
347
+
348
+ $savedKey = get_transient(self::OPTION_SLUG_ANTISPAM);
349
+ if (isset($_POST['antispamKey']) && $savedKey && $savedKey != $_POST['antispamKey']) {
350
+ die(__('Hacker?', 'wpdiscuz'));
351
+ }
352
+
353
  if ($uniqueId && $postId) {
354
  $form = $this->wpdiscuzForm->getForm($postId);
355
  $form->initFormFields();
382
  $user_id = 0;
383
  $name = $form->validateDefaultName($currentUser);
384
  $email = $form->validateDefaultEmail($currentUser, $isAnonymous);
385
+ $website_url = $form->validateDefaultWebsite($currentUser);
386
  }
387
 
388
  $comment_content = $this->helper->replaceCommentContentCode(trim($_POST['wc_comment']));
466
  $commentListArgs['comment_author_email'] = $email;
467
  $this->form = $this->wpdiscuzForm->getForm($postId);
468
  $commentListArgs['can_user_comment'] = $this->form ? $this->form->isUserCanComment($currentUser, $postId) : true;
469
+ $messageArray['message'] = wp_list_comments($commentListArgs, array($newComment));
470
  } else {
471
  $messageArray['code'] = 'wc_invalid_field';
472
  }
1197
  }
1198
 
1199
  public function pluginNewVersion() {
 
 
1200
  $pluginData = get_plugin_data(__FILE__);
1201
  if (version_compare($pluginData['Version'], $this->version, '>')) {
1202
+ $this->dbManager->createEmailNotificationTable();
1203
+ $this->dbManager->createAvatarsCacheTable();
1204
+ // $this->dbManager->createFollowUsersTable();
1205
  $this->wpdiscuzForm->createDefaultForm($this->version);
1206
  $options = $this->changeOldOptions(get_option(self::OPTION_SLUG_OPTIONS), $pluginData);
1207
  $this->addNewOptions($options);
1208
  $this->addNewPhrases();
1209
+ update_option(self::OPTION_SLUG_VERSION, $pluginData['Version']);
1210
+
 
 
 
1211
  if (version_compare($this->version, '2.1.2', '<=') && version_compare($this->version, '1.0.0', '!=')) {
1212
  $this->dbManager->alterPhrasesTable();
1213
  }
1216
  $this->dbManager->alterVotingTable();
1217
  }
1218
 
1219
+
1220
+ $this->dbManager->alterNotificationTable($this->version);
 
1221
  }
1222
  do_action('wpdiscuz_check_version');
1223
  }
1318
  'comment_status' => array(1),
1319
  'voting_icons' => $likeIcons,
1320
  'comments_open' => comments_open($post->ID),
1321
+ 'high_level_user' => current_user_can('moderate_comments'),
1322
+ 'avatar_trackback' => apply_filters('wpdiscuz_avatar_trackback', plugins_url(WPDISCUZ_DIR_NAME . '/assets/img/trackback.png'))
1323
  );
1324
  return apply_filters('wpdiscuz_comment_list_args', $args);
1325
  }
forms/wpDiscuzForm.php CHANGED
@@ -364,6 +364,7 @@ class wpDiscuzForm implements wpdFormConst {
364
  $postTypes = array(
365
  'post' => 'post',
366
  'attachment' => 'attachment',
 
367
  );
368
  $this->options->initPhrasesOnLoad();
369
  $generalOptions = $this->getDefaultFormGeneralOptions($version, $lang, $wpdGeneralOptions, $phrases, $postTypes);
364
  $postTypes = array(
365
  'post' => 'post',
366
  'attachment' => 'attachment',
367
+ 'page' => 'page',
368
  );
369
  $this->options->initPhrasesOnLoad();
370
  $generalOptions = $this->getDefaultFormGeneralOptions($version, $lang, $wpdGeneralOptions, $phrases, $postTypes);
forms/wpdFormAttr/Field/DefaultField/Submit.php CHANGED
@@ -25,6 +25,7 @@ class Submit extends Field {
25
  }
26
 
27
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
 
28
  $wpdiscuz = wpDiscuz();
29
  ?>
30
  <div class="wc-field-submit">
25
  }
26
 
27
  public function frontFormHtml($name, $args, $options, $currentUser, $uniqueId, $isMainForm) {
28
+ do_action('wpdiscuz_submit_button_before', $currentUser, $uniqueId, $isMainForm);
29
  $wpdiscuz = wpDiscuz();
30
  ?>
31
  <div class="wc-field-submit">
forms/wpdFormAttr/Form.php CHANGED
@@ -427,7 +427,7 @@ class Form {
427
  return $nameField->validateFieldData(wpdFormConst::WPDISCUZ_FORMS_NAME_FIELD, $args, $this->wpdOptions, $currentUser);
428
  }
429
 
430
- public function validateDefaultWebsit($currentUser) {
431
  $webSiteField = Field\DefaultField\Website::getInstance();
432
  $args = $this->formFields[wpdFormConst::WPDISCUZ_FORMS_WEBSITE_FIELD];
433
  return $webSiteField->validateFieldData(wpdFormConst::WPDISCUZ_FORMS_WEBSITE_FIELD, $args, $this->wpdOptions, $currentUser);
427
  return $nameField->validateFieldData(wpdFormConst::WPDISCUZ_FORMS_NAME_FIELD, $args, $this->wpdOptions, $currentUser);
428
  }
429
 
430
+ public function validateDefaultWebsite($currentUser) {
431
  $webSiteField = Field\DefaultField\Website::getInstance();
432
  $args = $this->formFields[wpdFormConst::WPDISCUZ_FORMS_WEBSITE_FIELD];
433
  return $webSiteField->validateFieldData(wpdFormConst::WPDISCUZ_FORMS_WEBSITE_FIELD, $args, $this->wpdOptions, $currentUser);
includes/class.WpdiscuzDBManager.php CHANGED
@@ -8,6 +8,7 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
8
  private $phrases;
9
  private $emailNotification;
10
  private $avatarsCache;
 
11
  public $isMySQL57;
12
  public $isShowLoadMore = false;
13
 
@@ -23,6 +24,7 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
23
  $this->phrases = $this->dbprefix . 'wc_phrases';
24
  $this->emailNotification = $this->dbprefix . 'wc_comments_subscription';
25
  $this->avatarsCache = $this->dbprefix . 'wc_avatars_cache';
 
26
  $this->isMySQL57 = version_compare($this->db->db_version(), '5.7', '>=') ? true : false;
27
  }
28
 
@@ -50,7 +52,7 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
50
  }
51
 
52
  if (!$this->isTableExists($this->emailNotification)) {
53
- $sql = "CREATE TABLE `" . $this->emailNotification . "`(`id` INT(11) NOT NULL AUTO_INCREMENT, `email` VARCHAR(255) NOT NULL, `subscribtion_id` INT(11) NOT NULL, `post_id` INT(11) NOT NULL, `subscribtion_type` VARCHAR(255) NOT NULL, `activation_key` VARCHAR(255) NOT NULL, `confirm` TINYINT DEFAULT 0, `subscription_date` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `subscribtion_id` (`subscribtion_id`), KEY `post_id` (`post_id`), KEY `confirm`(`confirm`), UNIQUE KEY `subscribe_unique_index` (`subscribtion_id`,`email`)) ENGINE=MYISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci AUTO_INCREMENT=1;";
54
  dbDelta($sql);
55
  }
56
 
@@ -58,6 +60,11 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
58
  $sql = "CREATE TABLE `" . $this->avatarsCache . "`(`id` INT(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL DEFAULT 0, `user_email` VARCHAR(255) NOT NULL, `url` VARCHAR(255) NOT NULL, `hash` VARCHAR(255) NOT NULL, `maketime` INT(11) NOT NULL DEFAULT 0, `cached` TINYINT(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `user_id` (`user_id`), UNIQUE KEY `user_email` (`user_email`), KEY `url` (`url`), KEY `hash` (`hash`), KEY `maketime` (`maketime`), KEY `cached` (`cached`)) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci AUTO_INCREMENT=1;";
59
  dbDelta($sql);
60
  }
 
 
 
 
 
61
  }
62
 
63
  /**
@@ -67,7 +74,7 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
67
  $this->initDB();
68
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
69
  if (!$this->isTableExists($this->emailNotification)) {
70
- $sql = "CREATE TABLE `" . $this->emailNotification . "`(`id` INT(11) NOT NULL AUTO_INCREMENT, `email` VARCHAR(255) NOT NULL, `subscribtion_id` INT(11) NOT NULL, `post_id` INT(11) NOT NULL, `subscribtion_type` VARCHAR(255) NOT NULL, `activation_key` VARCHAR(255) NOT NULL, `confirm` TINYINT DEFAULT 0, `subscription_date` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `subscribtion_id` (`subscribtion_id`), KEY `post_id` (`post_id`), KEY `confirm`(`confirm`), UNIQUE KEY `subscribe_unique_index` (`subscribtion_id`,`email`)) ENGINE=MYISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci AUTO_INCREMENT=1;";
71
  dbDelta($sql);
72
  }
73
  }
@@ -81,6 +88,15 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
81
  }
82
  }
83
 
 
 
 
 
 
 
 
 
 
84
  /**
85
  * add vote type
86
  */
@@ -204,7 +220,7 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
204
  $sqlComments = $this->db->prepare("SELECT `comment_ID` FROM `" . $this->dbprefix . "comments` WHERE `comment_post_ID` = %d $condition $commentParent $typesNotIn AND `comment_ID` $operator %d ORDER BY `comment_date_gmt` {$args['order']}, comment_ID {$args['order']} $limit", $args['post_id'], $args['last_parent_id']);
205
  } else {
206
  $sqlComments = $this->db->prepare("SELECT `comment_ID` FROM `" . $this->dbprefix . "comments` WHERE `comment_post_ID` = %d $condition $commentParent $typesNotIn ORDER BY `comment_date_gmt` {$args['order']}, comment_ID {$args['order']} $limit", $args['post_id']);
207
- }
208
  $data = $this->db->get_col($sqlComments);
209
  if (isset($args['limit']) && $args['limit'] != 0) {
210
  if ($this->isMySQL57) {
@@ -311,9 +327,9 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
311
  return $this->db->get_var($sql);
312
  }
313
 
314
- public function hasConfirmedSubscriptionByID($subscribID) {
315
  $sql = "SELECT `subscribtion_type` as `type` FROM `" . $this->emailNotification . "` WHERE `id` = %d AND `confirm` = 1;";
316
- $sql = $this->db->prepare($sql, $subscribID);
317
  return $this->db->get_var($sql);
318
  }
319
 
@@ -374,9 +390,11 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
374
  $this->db->query($sql_alter);
375
  }
376
 
377
- public function alterNotificationTable() {
378
- $sql_alter = "ALTER TABLE `" . $this->emailNotification . "` ADD UNIQUE KEY `subscribe_unique_index` (`subscribtion_id`,`email`);";
379
- $this->db->query($sql_alter);
 
 
380
  }
381
 
382
  /**
@@ -447,15 +465,6 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
447
  return $this->db->get_var($sql);
448
  }
449
 
450
- public function importOptions($serializedOptions) {
451
- if ($serializedOptions) {
452
- $serializedOptions = stripslashes($serializedOptions);
453
- $sql = "UPDATE `" . $this->dbprefix . "options` SET `option_value` = %s WHERE `option_name` = '" . self::OPTION_SLUG_OPTIONS . "'";
454
- $sql = $this->db->prepare($sql, $serializedOptions);
455
- $this->db->query($sql);
456
- }
457
- }
458
-
459
  /* MULTI SITE */
460
 
461
  public function getBlogID() {
@@ -551,4 +560,56 @@ class WpdiscuzDBManager implements WpDiscuzConstants {
551
  }
552
 
553
  /* === GRAVATARS CACHE === */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
554
  }
8
  private $phrases;
9
  private $emailNotification;
10
  private $avatarsCache;
11
+ // private $followUsers;
12
  public $isMySQL57;
13
  public $isShowLoadMore = false;
14
 
24
  $this->phrases = $this->dbprefix . 'wc_phrases';
25
  $this->emailNotification = $this->dbprefix . 'wc_comments_subscription';
26
  $this->avatarsCache = $this->dbprefix . 'wc_avatars_cache';
27
+ // $this->followUsers = $this->dbprefix . 'wc_follow_users';
28
  $this->isMySQL57 = version_compare($this->db->db_version(), '5.7', '>=') ? true : false;
29
  }
30
 
52
  }
53
 
54
  if (!$this->isTableExists($this->emailNotification)) {
55
+ $sql = "CREATE TABLE `" . $this->emailNotification . "`(`id` INT(11) NOT NULL AUTO_INCREMENT, `email` VARCHAR(255) NOT NULL, `subscribtion_id` INT(11) NOT NULL, `post_id` INT(11) NOT NULL, `subscribtion_type` VARCHAR(255) NOT NULL, `activation_key` VARCHAR(255) NOT NULL, `confirm` TINYINT DEFAULT 0, `subscription_date` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `subscribtion_id` (`subscribtion_id`), KEY `post_id` (`post_id`), KEY `confirm`(`confirm`), UNIQUE KEY `subscribe_unique_index` (`subscribtion_id`,`email`,`post_id`)) ENGINE=MYISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci AUTO_INCREMENT=1;";
56
  dbDelta($sql);
57
  }
58
 
60
  $sql = "CREATE TABLE `" . $this->avatarsCache . "`(`id` INT(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL DEFAULT 0, `user_email` VARCHAR(255) NOT NULL, `url` VARCHAR(255) NOT NULL, `hash` VARCHAR(255) NOT NULL, `maketime` INT(11) NOT NULL DEFAULT 0, `cached` TINYINT(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `user_id` (`user_id`), UNIQUE KEY `user_email` (`user_email`), KEY `url` (`url`), KEY `hash` (`hash`), KEY `maketime` (`maketime`), KEY `cached` (`cached`)) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci AUTO_INCREMENT=1;";
61
  dbDelta($sql);
62
  }
63
+
64
+ // if (!$this->isTableExists($this->followUsers)) {
65
+ // $sql = "CREATE TABLE `" . $this->followUsers . "` (`id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL DEFAULT '0', `user_email` varchar(255) NOT NULL, `follower_id` int(11) NOT NULL DEFAULT '0', `follower_email` varchar(255) NOT NULL, `activation_key` varchar(255) NOT NULL, `confirm` tinyint(1) NOT NULL DEFAULT '0', `follow_timestamp` int(11) NOT NULL, `follow_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `user_id` (`user_id`), KEY `user_email` (`user_email`), KEY `follower_id` (`follower_id`), KEY `follower_email` (`follower_email`), KEY `confirm` (`confirm`), KEY `follow_timestamp` (`follow_timestamp`)) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;";
66
+ // dbDelta($sql);
67
+ // }
68
  }
69
 
70
  /**
74
  $this->initDB();
75
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
76
  if (!$this->isTableExists($this->emailNotification)) {
77
+ $sql = "CREATE TABLE `" . $this->emailNotification . "`(`id` INT(11) NOT NULL AUTO_INCREMENT, `email` VARCHAR(255) NOT NULL, `subscribtion_id` INT(11) NOT NULL, `post_id` INT(11) NOT NULL, `subscribtion_type` VARCHAR(255) NOT NULL, `activation_key` VARCHAR(255) NOT NULL, `confirm` TINYINT DEFAULT 0, `subscription_date` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `subscribtion_id` (`subscribtion_id`), KEY `post_id` (`post_id`), KEY `confirm`(`confirm`), UNIQUE KEY `subscribe_unique_index` (`subscribtion_id`,`email`,`post_id`)) ENGINE=MYISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci AUTO_INCREMENT=1;";
78
  dbDelta($sql);
79
  }
80
  }
88
  }
89
  }
90
 
91
+ // public function createFollowUsersTable() {
92
+ // $this->initDB();
93
+ // require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
94
+ // if (!$this->isTableExists($this->followUsers)) {
95
+ // $sql = "CREATE TABLE `" . $this->followUsers . "` (`id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL DEFAULT '0', `user_email` varchar(255) NOT NULL, `follower_id` int(11) NOT NULL DEFAULT '0', `follower_email` varchar(255) NOT NULL, `activation_key` varchar(255) NOT NULL, `confirm` tinyint(1) NOT NULL DEFAULT '0', `follow_timestamp` int(11) NOT NULL, `follow_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `user_id` (`user_id`), KEY `user_email` (`user_email`), KEY `follower_id` (`follower_id`), KEY `follower_email` (`follower_email`), KEY `confirm` (`confirm`), KEY `follow_timestamp` (`follow_timestamp`)) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;";
96
+ // dbDelta($sql);
97
+ // }
98
+ // }
99
+
100
  /**
101
  * add vote type
102
  */
220
  $sqlComments = $this->db->prepare("SELECT `comment_ID` FROM `" . $this->dbprefix . "comments` WHERE `comment_post_ID` = %d $condition $commentParent $typesNotIn AND `comment_ID` $operator %d ORDER BY `comment_date_gmt` {$args['order']}, comment_ID {$args['order']} $limit", $args['post_id'], $args['last_parent_id']);
221
  } else {
222
  $sqlComments = $this->db->prepare("SELECT `comment_ID` FROM `" . $this->dbprefix . "comments` WHERE `comment_post_ID` = %d $condition $commentParent $typesNotIn ORDER BY `comment_date_gmt` {$args['order']}, comment_ID {$args['order']} $limit", $args['post_id']);
223
+ }
224
  $data = $this->db->get_col($sqlComments);
225
  if (isset($args['limit']) && $args['limit'] != 0) {
226
  if ($this->isMySQL57) {
327
  return $this->db->get_var($sql);
328
  }
329
 
330
+ public function hasConfirmedSubscriptionByID($subscribeID) {
331
  $sql = "SELECT `subscribtion_type` as `type` FROM `" . $this->emailNotification . "` WHERE `id` = %d AND `confirm` = 1;";
332
+ $sql = $this->db->prepare($sql, $subscribeID);
333
  return $this->db->get_var($sql);
334
  }
335
 
390
  $this->db->query($sql_alter);
391
  }
392
 
393
+ public function alterNotificationTable($version) {
394
+ if (version_compare($version, '5.0.4', '<=') && version_compare($version, '1.0.0', '!=')) {
395
+ $sql_alter = "ALTER TABLE `" . $this->emailNotification . "` ADD UNIQUE KEY `subscribe_unique_index` (`subscribtion_id`,`email`, `post_id`);";
396
+ $this->db->query($sql_alter);
397
+ }
398
  }
399
 
400
  /**
465
  return $this->db->get_var($sql);
466
  }
467
 
 
 
 
 
 
 
 
 
 
468
  /* MULTI SITE */
469
 
470
  public function getBlogID() {
560
  }
561
 
562
  /* === GRAVATARS CACHE === */
563
+
564
+ /* === STCR SUBSCRIPTIONS === */
565
+
566
+ public function getStcrAllSubscriptions() {
567
+ $sql = "SELECT COUNT(*) FROM `{$this->dbprefix}postmeta` WHERE meta_key LIKE '%_stcr@%' AND SUBSTRING(meta_value, 21) IN ('Y', 'R');";
568
+ return $this->db->get_var($sql);
569
+ }
570
+
571
+ public function getStcrSubscriptions($limit, $offset) {
572
+ $data = array();
573
+ if (intval($limit) && intval($offset) >= 0) {
574
+ $sql = "SELECT `post_id`, SUBSTRING(`meta_key`, 8) AS `email`, SUBSTRING(meta_value, 1, 19) AS `date`, LOWER(SUBSTRING(meta_value, 21)) AS `subscription_type`, 1 AS `status` FROM `{$this->dbprefix}postmeta` WHERE meta_key LIKE '%_stcr@%' AND SUBSTRING(meta_value, 21) IN ('Y', 'R') ORDER BY SUBSTRING(meta_value, 1, 19) ASC LIMIT $offset, $limit;";
575
+ $data = $this->db->get_results($sql, ARRAY_A);
576
+ }
577
+ return $data;
578
+ }
579
+
580
+ public function addStcrSubscriptions($subscriptions = array()) {
581
+
582
+ foreach ($subscriptions as $subscription) {
583
+ $email = $subscription['email'];
584
+ $subscriptionId = $subscription['post_id'];
585
+ $postId = $subscription['post_id'];
586
+ $subscriptionType = $subscription['subscription_type'] == 'y' ? self::SUBSCRIPTION_POST : self::SUBSCRIPTION_ALL_COMMENT;
587
+ $activationKey = md5($email . uniqid() . time());
588
+ $subscriptionDate = $subscription['date'];
589
+ $confirm = $subscription['status'];
590
+ $userSubscription = $this->getUserSubscription($email, $postId);
591
+
592
+ if ($userSubscription) {
593
+ if ($userSubscription['type'] == self::SUBSCRIPTION_POST) {
594
+ continue;
595
+ } else {
596
+ $sql = "UPDATE `$this->emailNotification` SET `subscribtion_id` = %d, `post_id` = %d, `subscribtion_type` = %s WHERE `id` = %d;";
597
+ $sql = $this->db->prepare($sql, $subscriptionId, $postId, $subscriptionType, $userSubscription['id']);
598
+ $this->db->query($sql);
599
+ }
600
+ } else {
601
+ $sql = "INSERT INTO `$this->emailNotification` (`email`, `subscribtion_id`, `post_id`, `subscribtion_type`, `activation_key`, `confirm`, `subscription_date`) VALUES (%s, %d, %d, %s, %s, %d, %s);";
602
+ $sql = $this->db->prepare($sql, $email, $postId, $postId, $subscriptionType, $activationKey, $confirm, $subscriptionDate);
603
+ $this->db->query($sql);
604
+ }
605
+ }
606
+ }
607
+
608
+ public function getUserSubscription($email, $postId) {
609
+ $sql = "SELECT `id`, `subscribtion_type` as `type` FROM `" . $this->emailNotification . "` WHERE `email` = %s AND `post_id` = %d AND `confirm` = 1;";
610
+ $sql = $this->db->prepare($sql, $email, $postId);
611
+ return $this->db->get_row($sql, ARRAY_A);
612
+ }
613
+
614
+ /* === STCR SUBSCRIPTIONS === */
615
  }
includes/interface.WpDiscuzConstants.php CHANGED
@@ -10,6 +10,7 @@ interface WpDiscuzConstants {
10
  const OPTION_SLUG_VERSION = 'wc_plugin_version';
11
  const OPTION_SLUG_DEACTIVATION = 'wc_deactivation_modal_never_show';
12
  const OPTION_SLUG_SHOW_DEMO = 'wc_show_addons_demo';
 
13
  /* === OPTIONS SLUGS === */
14
  const PAGE_SETTINGS = 'wpdiscuz_options_page';
15
  const PAGE_PHRASES = 'wpdiscuz_phrases_page';
@@ -39,4 +40,7 @@ interface WpDiscuzConstants {
39
  const GRAVATARS_CACHE_DELETE_ACTION = 'wpdiscuz_gravatars_cache_delete';
40
  /* === STICKY COMMENTS === */
41
  const WPDISCUZ_STICKY_COMMENT = 'wpdiscuz_sticky';
 
 
 
42
  }
10
  const OPTION_SLUG_VERSION = 'wc_plugin_version';
11
  const OPTION_SLUG_DEACTIVATION = 'wc_deactivation_modal_never_show';
12
  const OPTION_SLUG_SHOW_DEMO = 'wc_show_addons_demo';
13
+ const OPTION_SLUG_ANTISPAM = 'wc_antispam_key';
14
  /* === OPTIONS SLUGS === */
15
  const PAGE_SETTINGS = 'wpdiscuz_options_page';
16
  const PAGE_PHRASES = 'wpdiscuz_phrases_page';
40
  const GRAVATARS_CACHE_DELETE_ACTION = 'wpdiscuz_gravatars_cache_delete';
41
  /* === STICKY COMMENTS === */
42
  const WPDISCUZ_STICKY_COMMENT = 'wpdiscuz_sticky';
43
+ /* === TOOLS === */
44
+ const OPTIONS_DIR = '/wpdiscuz/options/';
45
+ const OPTIONS_FILENAME = 'wpdiscuz-options';
46
  }
languages/wpdiscuz.pot CHANGED
@@ -3,8 +3,8 @@ msgid ""
3
  msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: wpDiscuz\n"
6
- "POT-Creation-Date: 2018-03-02 15:46+0400\n"
7
- "PO-Revision-Date: 2018-03-02 15:46+0400\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
10
  "MIME-Version: 1.0\n"
@@ -28,11 +28,16 @@ msgstr ""
28
  msgid "Every 48 hours"
29
  msgstr ""
30
 
31
- #: class.WpdiscuzCore.php:409
 
 
 
 
 
32
  msgid "This is closed comment thread"
33
  msgstr ""
34
 
35
- #: class.WpdiscuzCore.php:1050 class.WpdiscuzCore.php:1267
36
  #: options/options-layouts/settings-social.php:40
37
  #: options/options-layouts/settings-social.php:42
38
  #: options/options-layouts/settings-social.php:44
@@ -40,53 +45,53 @@ msgstr ""
40
  msgid "Settings"
41
  msgstr ""
42
 
43
- #: class.WpdiscuzCore.php:1052 class.WpdiscuzCore.php:1269
44
  msgid "Phrases"
45
  msgstr ""
46
 
47
- #: class.WpdiscuzCore.php:1054
48
  msgid "Tools"
49
  msgstr ""
50
 
51
- #: class.WpdiscuzCore.php:1055 options/html-options.php:22
52
  #: options/html-options.php:64 options/options-layouts/settings-addons.php:14
53
  msgid "Addons"
54
  msgstr ""
55
 
56
- #: class.WpdiscuzCore.php:1067
57
  msgid "Do you really want to reset all options?"
58
  msgstr ""
59
 
60
- #: class.WpdiscuzCore.php:1068
61
  msgid "Do you really want to remove voting data?"
62
  msgstr ""
63
 
64
- #: class.WpdiscuzCore.php:1069
65
  msgid "Do you really want to delete gravatars cache?"
66
  msgstr ""
67
 
68
- #: class.WpdiscuzCore.php:1106
69
  msgid "Please check one of reasons before sending feedback!"
70
  msgstr ""
71
 
72
- #: class.WpdiscuzCore.php:1107 utils/deactivation-reason-modal.php:58
73
  msgid "Please provide more information"
74
  msgstr ""
75
 
76
- #: class.WpdiscuzCore.php:1330 options/phrases-layouts/phrases-comment.php:56
77
  msgid "Admin"
78
  msgstr ""
79
 
80
- #: class.WpdiscuzCore.php:1332 class.WpdiscuzCore.php:1341
81
  #: options/phrases-layouts/phrases-comment.php:58
82
  msgid "Author"
83
  msgstr ""
84
 
85
- #: class.WpdiscuzCore.php:1336 options/phrases-layouts/phrases-comment.php:64
86
  msgid "Member"
87
  msgstr ""
88
 
89
- #: class.WpdiscuzCore.php:1342 options/phrases-layouts/phrases-comment.php:62
90
  msgid "Guest"
91
  msgstr ""
92
 
@@ -199,12 +204,12 @@ msgstr ""
199
  msgid "Default Form"
200
  msgstr ""
201
 
202
- #: forms/wpDiscuzForm.php:387 forms/wpDiscuzForm.php:395
203
  #: forms/wpdFormAttr/Form.php:657
204
  msgid "Leave a Reply"
205
  msgstr ""
206
 
207
- #: forms/wpDiscuzForm.php:410 forms/wpdFormAttr/Field/CheckboxField.php:12
208
  #: forms/wpdFormAttr/Field/ColorField.php:12
209
  #: forms/wpdFormAttr/Field/DateField.php:12
210
  #: forms/wpdFormAttr/Field/DefaultField/Captcha.php:27
@@ -223,37 +228,37 @@ msgstr ""
223
  msgid "Name"
224
  msgstr ""
225
 
226
- #: forms/wpDiscuzForm.php:412 forms/wpdFormAttr/Field/DefaultField/Email.php:64
227
  #: forms/wpdFormAttr/Form.php:776
228
  #: options/class.WpdiscuzOptionsSerialized.php:666 options/html-phrases.php:25
229
  msgid "Email"
230
  msgstr ""
231
 
232
- #: forms/wpDiscuzForm.php:414
233
  msgid "WebSite URL"
234
  msgstr ""
235
 
236
- #: forms/wpDiscuzForm.php:417
237
- #: forms/wpdFormAttr/Field/DefaultField/Submit.php:112
238
  #: forms/wpdFormAttr/Form.php:799
239
  msgid "Post Comment"
240
  msgstr ""
241
 
242
- #: forms/wpDiscuzForm.php:426
243
  msgid "Clone Form"
244
  msgstr ""
245
 
246
- #: forms/wpDiscuzForm.php:438
247
  msgid "Clone"
248
  msgstr ""
249
 
250
- #: forms/wpDiscuzForm.php:476
251
  msgid ""
252
  "Comment Form is not detected, please navigate to form manager page to create "
253
  "it. "
254
  msgstr ""
255
 
256
- #: forms/wpDiscuzForm.php:477
257
  msgid "Add Comment Form"
258
  msgstr ""
259
 
@@ -474,11 +479,11 @@ msgstr ""
474
  msgid "Button Text"
475
  msgstr ""
476
 
477
- #: forms/wpdFormAttr/Field/DefaultField/Submit.php:73
478
  msgid " - (on)"
479
  msgstr ""
480
 
481
- #: forms/wpdFormAttr/Field/DefaultField/Submit.php:74
482
  msgid " - (off)"
483
  msgstr ""
484
 
@@ -585,7 +590,7 @@ msgstr ""
585
  msgid "Comment Form Fields"
586
  msgstr ""
587
 
588
- #: options/addons/al/title.php:7 options/class.WpdiscuzOptions.php:311
589
  msgid "Advanced Likers"
590
  msgstr ""
591
 
@@ -601,11 +606,11 @@ msgstr ""
601
  msgid "More Addons..."
602
  msgstr ""
603
 
604
- #: options/addons/mu/title.php:7 options/class.WpdiscuzOptions.php:335
605
  msgid "Media Uploader"
606
  msgstr ""
607
 
608
- #: options/addons/raf/title.php:7 options/class.WpdiscuzOptions.php:315
609
  msgid "Report and Flagging"
610
  msgstr ""
611
 
@@ -613,11 +618,6 @@ msgstr ""
613
  msgid "Mentioning"
614
  msgstr ""
615
 
616
- #: options/class.WpdiscuzOptions.php:24 options/class.WpdiscuzOptions.php:107
617
- #: options/class.WpdiscuzOptions.php:238
618
- msgid "Hacker?"
619
- msgstr ""
620
-
621
  #: options/class.WpdiscuzOptions.php:98
622
  msgid "Settings updated"
623
  msgstr ""
@@ -626,113 +626,137 @@ msgstr ""
626
  msgid "Phrases updated"
627
  msgstr ""
628
 
629
- #: options/class.WpdiscuzOptions.php:273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
630
  msgid ""
631
  "Brings an ocean of emotions to your comments. It comes with an awesome smile "
632
  "package."
633
  msgstr ""
634
 
635
- #: options/class.WpdiscuzOptions.php:274
636
  msgid ""
637
  "Extended information about comment author with Profile, Activity, Votes and "
638
  "Subscriptions Tabs on pop-up window."
639
  msgstr ""
640
 
641
- #: options/class.WpdiscuzOptions.php:275
642
  msgid ""
643
  "Real-time online user checking, pop-up notification of new online users and "
644
  "online/offline badges."
645
  msgstr ""
646
 
647
- #: options/class.WpdiscuzOptions.php:276
648
  msgid ""
649
  "Allows to create private comment threads. Rich management options in "
650
  "dashboard by user roles."
651
  msgstr ""
652
 
653
- #: options/class.WpdiscuzOptions.php:277
654
  msgid ""
655
  "Total control over comment subscriptions. Full list, monitor, manage, "
656
  "filter, unsubscribe, confirm..."
657
  msgstr ""
658
 
659
- #: options/class.WpdiscuzOptions.php:278
660
  msgid ""
661
  "A full-fledged tool-kit for advertising in comment section of your website. "
662
  "Separate banner and ad managment."
663
  msgstr ""
664
 
665
- #: options/class.WpdiscuzOptions.php:279
666
  msgid ""
667
  "Allows to mention comments and users in comment text using #comment-id and "
668
  "@username tags."
669
  msgstr ""
670
 
671
- #: options/class.WpdiscuzOptions.php:280
672
  msgid ""
673
  "See comment likers and voters of each comment. Adds user reputation and "
674
  "badges based on received likes."
675
  msgstr ""
676
 
677
- #: options/class.WpdiscuzOptions.php:281
678
  msgid ""
679
  "Comment reporting tools. Auto-moderates comments based on number of flags "
680
  "and dislikes."
681
  msgstr ""
682
 
683
- #: options/class.WpdiscuzOptions.php:282
684
  msgid ""
685
  "Adds a smart and intuitive AJAX \"Translate\" button with 60 language "
686
  "options. Uses free translation API."
687
  msgstr ""
688
 
689
- #: options/class.WpdiscuzOptions.php:283
690
  msgid ""
691
  "AJAX powered front-end comment search. It starts searching while you type "
692
  "search words. "
693
  msgstr ""
694
 
695
- #: options/class.WpdiscuzOptions.php:284
696
  msgid ""
697
  "Most voted comments, Active comment threads, Most commented posts, Active "
698
  "comment authors"
699
  msgstr ""
700
 
701
- #: options/class.WpdiscuzOptions.php:285
702
  msgid ""
703
  "All in one powerful yet simple admin toolkit to moderate comments on front-"
704
  "end."
705
  msgstr ""
706
 
707
- #: options/class.WpdiscuzOptions.php:286
708
  msgid ""
709
  "Extended comment attachment system. Allows to upload images, videos, audios "
710
  "and other file types."
711
  msgstr ""
712
 
713
- #: options/class.WpdiscuzOptions.php:287
714
  msgid ""
715
  "Adds No CAPTCHA on all comment forms. Stops spam and bot comments with "
716
  "Google reCAPTCHA"
717
  msgstr ""
718
 
719
- #: options/class.WpdiscuzOptions.php:288
720
  msgid ""
721
  "Integrates myCRED Badges and Ranks. Converts wpDiscuz comment votes/likes to "
722
  "myCRED points. "
723
  msgstr ""
724
 
725
- #: options/class.WpdiscuzOptions.php:289
726
  msgid ""
727
  "Allows censoring comment words. Filters comments and replaces those phrases "
728
  "with custom words."
729
  msgstr ""
730
 
731
- #: options/class.WpdiscuzOptions.php:295
732
  msgid "Custom Comment Forms"
733
  msgstr ""
734
 
735
- #: options/class.WpdiscuzOptions.php:296
736
  msgid ""
737
  "You can create custom comment forms with wpDiscuz. wpDiscuz 4 comes with "
738
  "custom comment forms and fields. You can create custom comment forms for "
@@ -740,55 +764,55 @@ msgid ""
740
  "eaxample: text, dropdown, rating, checkboxes, etc..."
741
  msgstr ""
742
 
743
- #: options/class.WpdiscuzOptions.php:299
744
  msgid "Emoticons"
745
  msgstr ""
746
 
747
- #: options/class.WpdiscuzOptions.php:300
748
  msgid ""
749
  "You can add more emotions to your comments using wpDiscuz Emoticons addon."
750
  msgstr ""
751
 
752
- #: options/class.WpdiscuzOptions.php:303
753
  msgid "Ads Manager"
754
  msgstr ""
755
 
756
- #: options/class.WpdiscuzOptions.php:304
757
  msgid ""
758
  "Increase your income using ad banners. Comment area is the most active "
759
  "sections for advertising. wpDiscuz Ads Manager addon is designed to help you "
760
  "add banners and control ads in this section."
761
  msgstr ""
762
 
763
- #: options/class.WpdiscuzOptions.php:307
764
  msgid "User and Comment Mentioning"
765
  msgstr ""
766
 
767
- #: options/class.WpdiscuzOptions.php:308
768
  msgid ""
769
  "Using wpDiscuz User &amp; Comment Mentioning addon you can allow commenters "
770
  "mention comments and users in comment text using #comment-id and @username "
771
  "tags."
772
  msgstr ""
773
 
774
- #: options/class.WpdiscuzOptions.php:312
775
  msgid ""
776
  "wpDiscuz Advanced Likers addon displays likers and voters of each comment. "
777
  "Adds user reputation and badges based on received likes."
778
  msgstr ""
779
 
780
- #: options/class.WpdiscuzOptions.php:316
781
  msgid ""
782
  "Let your commenters help you to determine and remove spam comments. wpDiscuz "
783
  "Report and Flagging addon comes with comment reporting tools. Automaticaly "
784
  "auto-moderates comments based on number of flags and dislikes."
785
  msgstr ""
786
 
787
- #: options/class.WpdiscuzOptions.php:319
788
  msgid "Comment Translate"
789
  msgstr ""
790
 
791
- #: options/class.WpdiscuzOptions.php:320
792
  msgid ""
793
  "In most cases the big part of your visitors are not a native speakers of "
794
  "your language. Make your comments comprehensible for all visitors using "
@@ -797,11 +821,11 @@ msgid ""
797
  "translation API."
798
  msgstr ""
799
 
800
- #: options/class.WpdiscuzOptions.php:323
801
  msgid "Comment Search"
802
  msgstr ""
803
 
804
- #: options/class.WpdiscuzOptions.php:324
805
  msgid ""
806
  "You can let website visitor search in comments. It's always more attractive "
807
  "to find a comment about something that interest you. Using wpDiscuz Comment "
@@ -809,56 +833,56 @@ msgid ""
809
  "above comment list."
810
  msgstr ""
811
 
812
- #: options/class.WpdiscuzOptions.php:327
813
  msgid "wpDiscuz Widgets"
814
  msgstr ""
815
 
816
- #: options/class.WpdiscuzOptions.php:328
817
  msgid ""
818
  "More Comment Widgets! Most voted comments, Active comment threads, Most "
819
  "commented posts, Active comment authors widgets are available in wpDiscuz "
820
  "Widgets Addon"
821
  msgstr ""
822
 
823
- #: options/class.WpdiscuzOptions.php:331
824
  msgid "Front-end Moderation"
825
  msgstr ""
826
 
827
- #: options/class.WpdiscuzOptions.php:332
828
  msgid ""
829
  "You can moderate comments on front-end using all in one powerful yet simple "
830
  "wpDiscuz Frontend Moderation addon."
831
  msgstr ""
832
 
833
- #: options/class.WpdiscuzOptions.php:336
834
  msgid ""
835
  "You can let website visitors attach images and files to comments and embed "
836
  "video/audio content using wpDiscuz Media Uploader addon."
837
  msgstr ""
838
 
839
- #: options/class.WpdiscuzOptions.php:339
840
  msgid "Google ReCaptcha"
841
  msgstr ""
842
 
843
- #: options/class.WpdiscuzOptions.php:340
844
  msgid ""
845
  "Advanced spam protection with wpDiscuz Google reCAPTCHA addon. This addon "
846
  "adds No-CAPTCHA reCAPTCHA on all comment forms. Stops spam and bot comments."
847
  msgstr ""
848
 
849
- #: options/class.WpdiscuzOptions.php:355
850
  msgid "New Addons are available for wpDiscuz Comments Plugin"
851
  msgstr ""
852
 
853
- #: options/class.WpdiscuzOptions.php:362 options/class.WpdiscuzOptions.php:368
854
  msgid "Go to wpDiscuz Addons subMenu"
855
  msgstr ""
856
 
857
- #: options/class.WpdiscuzOptions.php:400
858
  msgid "Do you know?"
859
  msgstr ""
860
 
861
- #: options/class.WpdiscuzOptions.php:413
862
  msgid "More info"
863
  msgstr ""
864
 
@@ -1022,7 +1046,7 @@ msgid "You're subscribed for new follow-up comments on this post"
1022
  msgstr ""
1023
 
1024
  #: options/class.WpdiscuzOptionsSerialized.php:696
1025
- #: options/phrases-layouts/phrases-email.php:63
1026
  msgid "Unsubscribe"
1027
  msgstr ""
1028
 
@@ -1041,12 +1065,12 @@ msgid "You've successfully subscribed."
1041
  msgstr ""
1042
 
1043
  #: options/class.WpdiscuzOptionsSerialized.php:700
1044
- #: options/phrases-layouts/phrases-email.php:71
1045
  msgid "Confirm your subscription"
1046
  msgstr ""
1047
 
1048
  #: options/class.WpdiscuzOptionsSerialized.php:701
1049
- #: options/phrases-layouts/phrases-email.php:75
1050
  msgid "You've successfully confirmed your subscription."
1051
  msgstr ""
1052
 
@@ -1459,7 +1483,6 @@ msgid "Remove vote data"
1459
  msgstr ""
1460
 
1461
  #: options/html-options.php:157 options/html-phrases.php:72
1462
- #: options/html-tools.php:58
1463
  msgid "Save Changes"
1464
  msgstr ""
1465
 
@@ -1479,14 +1502,18 @@ msgstr ""
1479
  msgid "wpDiscuz Tools"
1480
  msgstr ""
1481
 
1482
- #: options/html-tools.php:22 options/tools-layouts/options-export.php:8
1483
  msgid "Export options"
1484
  msgstr ""
1485
 
1486
- #: options/html-tools.php:23 options/tools-layouts/options-import.php:7
1487
  msgid "Import options"
1488
  msgstr ""
1489
 
 
 
 
 
1490
  #: options/options-layouts/settings-addons.php:20
1491
  msgid ""
1492
  "Here you can find wpDiscuz Addons' setting options in vertical subTabs with "
@@ -1615,66 +1642,59 @@ msgid ""
1615
  "textarea. Leave the max value empty to remove the limit."
1616
  msgstr ""
1617
 
1618
- #: options/options-layouts/settings-form.php:75
1619
- msgid ""
1620
- "The plugin captcha directory is not writable! Please set writable "
1621
- "permissions on \"wpdiscuz/utils/temp\" directory in order to use the first "
1622
- "type of captcha generation"
1623
- msgstr ""
1624
-
1625
- #: options/options-layouts/settings-form.php:80
1626
  msgid "Captcha generation type"
1627
  msgstr ""
1628
 
1629
- #: options/options-layouts/settings-form.php:85
1630
  msgid "File system"
1631
  msgstr ""
1632
 
1633
- #: options/options-layouts/settings-form.php:86
1634
  msgid "WP Session"
1635
  msgstr ""
1636
 
1637
- #: options/options-layouts/settings-form.php:93
1638
  msgid "Enable Quicktags"
1639
  msgstr ""
1640
 
1641
- #: options/options-layouts/settings-form.php:94
1642
  msgid ""
1643
  "Quicktag is a on-click button that inserts HTML in to comment textarea. For "
1644
  "example the \"b\" Quicktag will insert the HTML bold tags < b > < /b >."
1645
  msgstr ""
1646
 
1647
- #: options/options-layouts/settings-form.php:103
1648
  msgid "Enable automatic image URL to image HTML conversion"
1649
  msgstr ""
1650
 
1651
- #: options/options-layouts/settings-form.php:112
1652
  msgid "Allow comment editing for"
1653
  msgstr ""
1654
 
1655
- #: options/options-layouts/settings-form.php:117
1656
  msgid "Do not allow"
1657
  msgstr ""
1658
 
1659
- #: options/options-layouts/settings-form.php:118
1660
- #: options/options-layouts/settings-form.php:119
1661
  #: options/options-layouts/settings-live-update.php:53
1662
  #: options/options-layouts/settings-live-update.php:54
1663
  #: options/options-layouts/settings-live-update.php:55
1664
  msgid "Minutes"
1665
  msgstr ""
1666
 
1667
- #: options/options-layouts/settings-form.php:120
1668
  #: options/phrases-layouts/phrases-datetime.php:35
1669
  msgid "Hour"
1670
  msgstr ""
1671
 
1672
- #: options/options-layouts/settings-form.php:121
1673
- #: options/options-layouts/settings-form.php:122
1674
  msgid "Hours"
1675
  msgstr ""
1676
 
1677
- #: options/options-layouts/settings-form.php:123
1678
  msgid "Unlimit"
1679
  msgstr ""
1680
 
@@ -2337,46 +2357,50 @@ msgstr ""
2337
  msgid "Email Template Phrases"
2338
  msgstr ""
2339
 
2340
- #: options/phrases-layouts/phrases-email.php:21
2341
  msgid "Email Notification Subject on New Comment"
2342
  msgstr ""
2343
 
2344
- #: options/phrases-layouts/phrases-email.php:26
2345
- msgid "Email Notification on New Comment"
 
 
 
 
 
 
 
2346
  msgstr ""
2347
 
2348
- #: options/phrases-layouts/phrases-email.php:27
2349
- #: options/phrases-layouts/phrases-email.php:48
2350
- #: options/phrases-layouts/phrases-email.php:85
2351
- #: options/phrases-layouts/phrases-email.php:104
2352
- msgid "Available shortcodes"
2353
  msgstr ""
2354
 
2355
- #: options/phrases-layouts/phrases-email.php:42
2356
  msgid "Email Notification Subject on New Reply"
2357
  msgstr ""
2358
 
2359
- #: options/phrases-layouts/phrases-email.php:47
2360
  msgid "Email Notification on New Reply"
2361
  msgstr ""
2362
 
2363
- #: options/phrases-layouts/phrases-email.php:67
2364
  msgid "Ignore subscription"
2365
  msgstr ""
2366
 
2367
- #: options/phrases-layouts/phrases-email.php:79
2368
  msgid "Subscribe confirmation email subject"
2369
  msgstr ""
2370
 
2371
- #: options/phrases-layouts/phrases-email.php:84
2372
  msgid "Subscribe confirmation email content"
2373
  msgstr ""
2374
 
2375
- #: options/phrases-layouts/phrases-email.php:97
2376
  msgid "Comment approved subject"
2377
  msgstr ""
2378
 
2379
- #: options/phrases-layouts/phrases-email.php:102
2380
  msgid "Comment approved message"
2381
  msgstr ""
2382
 
@@ -2544,22 +2568,41 @@ msgstr ""
2544
  msgid "Message if commenting disabled by user role"
2545
  msgstr ""
2546
 
2547
- #: options/tools-layouts/options-export.php:10
2548
  msgid ""
2549
- "You can transfer the saved options data between different installs by "
2550
- "copying the text inside this textarea. To import data from another install, "
2551
- "navigate to \"Import Options\" Tab and put the data in textarea with the one "
2552
- "from another install and click \"Save Changes\". Make sure you use the same "
2553
- "wpDiscuz versions."
 
 
 
 
 
2554
  msgstr ""
2555
 
2556
  #: options/tools-layouts/options-import.php:9
2557
  msgid ""
2558
- "You can transfer the saved options data between different installs by "
2559
- "copying the text inside this textarea in \"Export Options\" Tab. To import "
2560
- "data from another install, just put the data in textarea with the one from "
2561
- "another install and click \"Save Changes\". Make sure you use the same "
2562
- "wpDiscuz versions."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2563
  msgstr ""
2564
 
2565
  #: templates/comment/comment-form.php:78
3
  msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: wpDiscuz\n"
6
+ "POT-Creation-Date: 2018-03-20 19:57+0400\n"
7
+ "PO-Revision-Date: 2018-03-20 19:57+0400\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
10
  "MIME-Version: 1.0\n"
28
  msgid "Every 48 hours"
29
  msgstr ""
30
 
31
+ #: class.WpdiscuzCore.php:350 options/class.WpdiscuzOptions.php:24
32
+ #: options/class.WpdiscuzOptions.php:107 options/class.WpdiscuzOptions.php:280
33
+ msgid "Hacker?"
34
+ msgstr ""
35
+
36
+ #: class.WpdiscuzCore.php:415
37
  msgid "This is closed comment thread"
38
  msgstr ""
39
 
40
+ #: class.WpdiscuzCore.php:1056 class.WpdiscuzCore.php:1270
41
  #: options/options-layouts/settings-social.php:40
42
  #: options/options-layouts/settings-social.php:42
43
  #: options/options-layouts/settings-social.php:44
45
  msgid "Settings"
46
  msgstr ""
47
 
48
+ #: class.WpdiscuzCore.php:1058 class.WpdiscuzCore.php:1272
49
  msgid "Phrases"
50
  msgstr ""
51
 
52
+ #: class.WpdiscuzCore.php:1060
53
  msgid "Tools"
54
  msgstr ""
55
 
56
+ #: class.WpdiscuzCore.php:1061 options/html-options.php:22
57
  #: options/html-options.php:64 options/options-layouts/settings-addons.php:14
58
  msgid "Addons"
59
  msgstr ""
60
 
61
+ #: class.WpdiscuzCore.php:1073
62
  msgid "Do you really want to reset all options?"
63
  msgstr ""
64
 
65
+ #: class.WpdiscuzCore.php:1074
66
  msgid "Do you really want to remove voting data?"
67
  msgstr ""
68
 
69
+ #: class.WpdiscuzCore.php:1075
70
  msgid "Do you really want to delete gravatars cache?"
71
  msgstr ""
72
 
73
+ #: class.WpdiscuzCore.php:1112
74
  msgid "Please check one of reasons before sending feedback!"
75
  msgstr ""
76
 
77
+ #: class.WpdiscuzCore.php:1113 utils/deactivation-reason-modal.php:58
78
  msgid "Please provide more information"
79
  msgstr ""
80
 
81
+ #: class.WpdiscuzCore.php:1334 options/phrases-layouts/phrases-comment.php:56
82
  msgid "Admin"
83
  msgstr ""
84
 
85
+ #: class.WpdiscuzCore.php:1336 class.WpdiscuzCore.php:1345
86
  #: options/phrases-layouts/phrases-comment.php:58
87
  msgid "Author"
88
  msgstr ""
89
 
90
+ #: class.WpdiscuzCore.php:1340 options/phrases-layouts/phrases-comment.php:64
91
  msgid "Member"
92
  msgstr ""
93
 
94
+ #: class.WpdiscuzCore.php:1346 options/phrases-layouts/phrases-comment.php:62
95
  msgid "Guest"
96
  msgstr ""
97
 
204
  msgid "Default Form"
205
  msgstr ""
206
 
207
+ #: forms/wpDiscuzForm.php:388 forms/wpDiscuzForm.php:396
208
  #: forms/wpdFormAttr/Form.php:657
209
  msgid "Leave a Reply"
210
  msgstr ""
211
 
212
+ #: forms/wpDiscuzForm.php:411 forms/wpdFormAttr/Field/CheckboxField.php:12
213
  #: forms/wpdFormAttr/Field/ColorField.php:12
214
  #: forms/wpdFormAttr/Field/DateField.php:12
215
  #: forms/wpdFormAttr/Field/DefaultField/Captcha.php:27
228
  msgid "Name"
229
  msgstr ""
230
 
231
+ #: forms/wpDiscuzForm.php:413 forms/wpdFormAttr/Field/DefaultField/Email.php:64
232
  #: forms/wpdFormAttr/Form.php:776
233
  #: options/class.WpdiscuzOptionsSerialized.php:666 options/html-phrases.php:25
234
  msgid "Email"
235
  msgstr ""
236
 
237
+ #: forms/wpDiscuzForm.php:415
238
  msgid "WebSite URL"
239
  msgstr ""
240
 
241
+ #: forms/wpDiscuzForm.php:418
242
+ #: forms/wpdFormAttr/Field/DefaultField/Submit.php:113
243
  #: forms/wpdFormAttr/Form.php:799
244
  msgid "Post Comment"
245
  msgstr ""
246
 
247
+ #: forms/wpDiscuzForm.php:427
248
  msgid "Clone Form"
249
  msgstr ""
250
 
251
+ #: forms/wpDiscuzForm.php:439
252
  msgid "Clone"
253
  msgstr ""
254
 
255
+ #: forms/wpDiscuzForm.php:477
256
  msgid ""
257
  "Comment Form is not detected, please navigate to form manager page to create "
258
  "it. "
259
  msgstr ""
260
 
261
+ #: forms/wpDiscuzForm.php:478
262
  msgid "Add Comment Form"
263
  msgstr ""
264
 
479
  msgid "Button Text"
480
  msgstr ""
481
 
482
+ #: forms/wpdFormAttr/Field/DefaultField/Submit.php:74
483
  msgid " - (on)"
484
  msgstr ""
485
 
486
+ #: forms/wpdFormAttr/Field/DefaultField/Submit.php:75
487
  msgid " - (off)"
488
  msgstr ""
489
 
590
  msgid "Comment Form Fields"
591
  msgstr ""
592
 
593
+ #: options/addons/al/title.php:7 options/class.WpdiscuzOptions.php:337
594
  msgid "Advanced Likers"
595
  msgstr ""
596
 
606
  msgid "More Addons..."
607
  msgstr ""
608
 
609
+ #: options/addons/mu/title.php:7 options/class.WpdiscuzOptions.php:361
610
  msgid "Media Uploader"
611
  msgstr ""
612
 
613
+ #: options/addons/raf/title.php:7 options/class.WpdiscuzOptions.php:341
614
  msgid "Report and Flagging"
615
  msgstr ""
616
 
618
  msgid "Mentioning"
619
  msgstr ""
620
 
 
 
 
 
 
621
  #: options/class.WpdiscuzOptions.php:98
622
  msgid "Settings updated"
623
  msgstr ""
626
  msgid "Phrases updated"
627
  msgstr ""
628
 
629
+ #: options/class.WpdiscuzOptions.php:254
630
+ msgid "Options were backed up!"
631
+ msgstr ""
632
+
633
+ #: options/class.WpdiscuzOptions.php:256
634
+ msgid "Cannot back up the options!"
635
+ msgstr ""
636
+
637
+ #: options/class.WpdiscuzOptions.php:267
638
+ msgid "Options Imported Successfully!"
639
+ msgstr ""
640
+
641
+ #: options/class.WpdiscuzOptions.php:269
642
+ msgid "Error occured! File content is empty or data is not valid!"
643
+ msgstr ""
644
+
645
+ #: options/class.WpdiscuzOptions.php:272
646
+ msgid "Error occured! Can not get file content!"
647
+ msgstr ""
648
+
649
+ #: options/class.WpdiscuzOptions.php:275
650
+ msgid "Error occured! Please choose file!"
651
+ msgstr ""
652
+
653
+ #: options/class.WpdiscuzOptions.php:299
654
  msgid ""
655
  "Brings an ocean of emotions to your comments. It comes with an awesome smile "
656
  "package."
657
  msgstr ""
658
 
659
+ #: options/class.WpdiscuzOptions.php:300
660
  msgid ""
661
  "Extended information about comment author with Profile, Activity, Votes and "
662
  "Subscriptions Tabs on pop-up window."
663
  msgstr ""
664
 
665
+ #: options/class.WpdiscuzOptions.php:301
666
  msgid ""
667
  "Real-time online user checking, pop-up notification of new online users and "
668
  "online/offline badges."
669
  msgstr ""
670
 
671
+ #: options/class.WpdiscuzOptions.php:302
672
  msgid ""
673
  "Allows to create private comment threads. Rich management options in "
674
  "dashboard by user roles."
675
  msgstr ""
676
 
677
+ #: options/class.WpdiscuzOptions.php:303
678
  msgid ""
679
  "Total control over comment subscriptions. Full list, monitor, manage, "
680
  "filter, unsubscribe, confirm..."
681
  msgstr ""
682
 
683
+ #: options/class.WpdiscuzOptions.php:304
684
  msgid ""
685
  "A full-fledged tool-kit for advertising in comment section of your website. "
686
  "Separate banner and ad managment."
687
  msgstr ""
688
 
689
+ #: options/class.WpdiscuzOptions.php:305
690
  msgid ""
691
  "Allows to mention comments and users in comment text using #comment-id and "
692
  "@username tags."
693
  msgstr ""
694
 
695
+ #: options/class.WpdiscuzOptions.php:306
696
  msgid ""
697
  "See comment likers and voters of each comment. Adds user reputation and "
698
  "badges based on received likes."
699
  msgstr ""
700
 
701
+ #: options/class.WpdiscuzOptions.php:307
702
  msgid ""
703
  "Comment reporting tools. Auto-moderates comments based on number of flags "
704
  "and dislikes."
705
  msgstr ""
706
 
707
+ #: options/class.WpdiscuzOptions.php:308
708
  msgid ""
709
  "Adds a smart and intuitive AJAX \"Translate\" button with 60 language "
710
  "options. Uses free translation API."
711
  msgstr ""
712
 
713
+ #: options/class.WpdiscuzOptions.php:309
714
  msgid ""
715
  "AJAX powered front-end comment search. It starts searching while you type "
716
  "search words. "
717
  msgstr ""
718
 
719
+ #: options/class.WpdiscuzOptions.php:310
720
  msgid ""
721
  "Most voted comments, Active comment threads, Most commented posts, Active "
722
  "comment authors"
723
  msgstr ""
724
 
725
+ #: options/class.WpdiscuzOptions.php:311
726
  msgid ""
727
  "All in one powerful yet simple admin toolkit to moderate comments on front-"
728
  "end."
729
  msgstr ""
730
 
731
+ #: options/class.WpdiscuzOptions.php:312
732
  msgid ""
733
  "Extended comment attachment system. Allows to upload images, videos, audios "
734
  "and other file types."
735
  msgstr ""
736
 
737
+ #: options/class.WpdiscuzOptions.php:313
738
  msgid ""
739
  "Adds No CAPTCHA on all comment forms. Stops spam and bot comments with "
740
  "Google reCAPTCHA"
741
  msgstr ""
742
 
743
+ #: options/class.WpdiscuzOptions.php:314
744
  msgid ""
745
  "Integrates myCRED Badges and Ranks. Converts wpDiscuz comment votes/likes to "
746
  "myCRED points. "
747
  msgstr ""
748
 
749
+ #: options/class.WpdiscuzOptions.php:315
750
  msgid ""
751
  "Allows censoring comment words. Filters comments and replaces those phrases "
752
  "with custom words."
753
  msgstr ""
754
 
755
+ #: options/class.WpdiscuzOptions.php:321
756
  msgid "Custom Comment Forms"
757
  msgstr ""
758
 
759
+ #: options/class.WpdiscuzOptions.php:322
760
  msgid ""
761
  "You can create custom comment forms with wpDiscuz. wpDiscuz 4 comes with "
762
  "custom comment forms and fields. You can create custom comment forms for "
764
  "eaxample: text, dropdown, rating, checkboxes, etc..."
765
  msgstr ""
766
 
767
+ #: options/class.WpdiscuzOptions.php:325
768
  msgid "Emoticons"
769
  msgstr ""
770
 
771
+ #: options/class.WpdiscuzOptions.php:326
772
  msgid ""
773
  "You can add more emotions to your comments using wpDiscuz Emoticons addon."
774
  msgstr ""
775
 
776
+ #: options/class.WpdiscuzOptions.php:329
777
  msgid "Ads Manager"
778
  msgstr ""
779
 
780
+ #: options/class.WpdiscuzOptions.php:330
781
  msgid ""
782
  "Increase your income using ad banners. Comment area is the most active "
783
  "sections for advertising. wpDiscuz Ads Manager addon is designed to help you "
784
  "add banners and control ads in this section."
785
  msgstr ""
786
 
787
+ #: options/class.WpdiscuzOptions.php:333
788
  msgid "User and Comment Mentioning"
789
  msgstr ""
790
 
791
+ #: options/class.WpdiscuzOptions.php:334
792
  msgid ""
793
  "Using wpDiscuz User &amp; Comment Mentioning addon you can allow commenters "
794
  "mention comments and users in comment text using #comment-id and @username "
795
  "tags."
796
  msgstr ""
797
 
798
+ #: options/class.WpdiscuzOptions.php:338
799
  msgid ""
800
  "wpDiscuz Advanced Likers addon displays likers and voters of each comment. "
801
  "Adds user reputation and badges based on received likes."
802
  msgstr ""
803
 
804
+ #: options/class.WpdiscuzOptions.php:342
805
  msgid ""
806
  "Let your commenters help you to determine and remove spam comments. wpDiscuz "
807
  "Report and Flagging addon comes with comment reporting tools. Automaticaly "
808
  "auto-moderates comments based on number of flags and dislikes."
809
  msgstr ""
810
 
811
+ #: options/class.WpdiscuzOptions.php:345
812
  msgid "Comment Translate"
813
  msgstr ""
814
 
815
+ #: options/class.WpdiscuzOptions.php:346
816
  msgid ""
817
  "In most cases the big part of your visitors are not a native speakers of "
818
  "your language. Make your comments comprehensible for all visitors using "
821
  "translation API."
822
  msgstr ""
823
 
824
+ #: options/class.WpdiscuzOptions.php:349
825
  msgid "Comment Search"
826
  msgstr ""
827
 
828
+ #: options/class.WpdiscuzOptions.php:350
829
  msgid ""
830
  "You can let website visitor search in comments. It's always more attractive "
831
  "to find a comment about something that interest you. Using wpDiscuz Comment "
833
  "above comment list."
834
  msgstr ""
835
 
836
+ #: options/class.WpdiscuzOptions.php:353
837
  msgid "wpDiscuz Widgets"
838
  msgstr ""
839
 
840
+ #: options/class.WpdiscuzOptions.php:354
841
  msgid ""
842
  "More Comment Widgets! Most voted comments, Active comment threads, Most "
843
  "commented posts, Active comment authors widgets are available in wpDiscuz "
844
  "Widgets Addon"
845
  msgstr ""
846
 
847
+ #: options/class.WpdiscuzOptions.php:357
848
  msgid "Front-end Moderation"
849
  msgstr ""
850
 
851
+ #: options/class.WpdiscuzOptions.php:358
852
  msgid ""
853
  "You can moderate comments on front-end using all in one powerful yet simple "
854
  "wpDiscuz Frontend Moderation addon."
855
  msgstr ""
856
 
857
+ #: options/class.WpdiscuzOptions.php:362
858
  msgid ""
859
  "You can let website visitors attach images and files to comments and embed "
860
  "video/audio content using wpDiscuz Media Uploader addon."
861
  msgstr ""
862
 
863
+ #: options/class.WpdiscuzOptions.php:365
864
  msgid "Google ReCaptcha"
865
  msgstr ""
866
 
867
+ #: options/class.WpdiscuzOptions.php:366
868
  msgid ""
869
  "Advanced spam protection with wpDiscuz Google reCAPTCHA addon. This addon "
870
  "adds No-CAPTCHA reCAPTCHA on all comment forms. Stops spam and bot comments."
871
  msgstr ""
872
 
873
+ #: options/class.WpdiscuzOptions.php:382
874
  msgid "New Addons are available for wpDiscuz Comments Plugin"
875
  msgstr ""
876
 
877
+ #: options/class.WpdiscuzOptions.php:389 options/class.WpdiscuzOptions.php:395
878
  msgid "Go to wpDiscuz Addons subMenu"
879
  msgstr ""
880
 
881
+ #: options/class.WpdiscuzOptions.php:427
882
  msgid "Do you know?"
883
  msgstr ""
884
 
885
+ #: options/class.WpdiscuzOptions.php:440
886
  msgid "More info"
887
  msgstr ""
888
 
1046
  msgstr ""
1047
 
1048
  #: options/class.WpdiscuzOptionsSerialized.php:696
1049
+ #: options/phrases-layouts/phrases-email.php:77
1050
  msgid "Unsubscribe"
1051
  msgstr ""
1052
 
1065
  msgstr ""
1066
 
1067
  #: options/class.WpdiscuzOptionsSerialized.php:700
1068
+ #: options/phrases-layouts/phrases-email.php:85
1069
  msgid "Confirm your subscription"
1070
  msgstr ""
1071
 
1072
  #: options/class.WpdiscuzOptionsSerialized.php:701
1073
+ #: options/phrases-layouts/phrases-email.php:89
1074
  msgid "You've successfully confirmed your subscription."
1075
  msgstr ""
1076
 
1483
  msgstr ""
1484
 
1485
  #: options/html-options.php:157 options/html-phrases.php:72
 
1486
  msgid "Save Changes"
1487
  msgstr ""
1488
 
1502
  msgid "wpDiscuz Tools"
1503
  msgstr ""
1504
 
1505
+ #: options/html-tools.php:15 options/tools-layouts/options-export.php:7
1506
  msgid "Export options"
1507
  msgstr ""
1508
 
1509
+ #: options/html-tools.php:16 options/tools-layouts/options-import.php:7
1510
  msgid "Import options"
1511
  msgstr ""
1512
 
1513
+ #: options/html-tools.php:17 options/tools-layouts/subscriptions-import.php:9
1514
+ msgid "Import subscriptions"
1515
+ msgstr ""
1516
+
1517
  #: options/options-layouts/settings-addons.php:20
1518
  msgid ""
1519
  "Here you can find wpDiscuz Addons' setting options in vertical subTabs with "
1642
  "textarea. Leave the max value empty to remove the limit."
1643
  msgstr ""
1644
 
1645
+ #: options/options-layouts/settings-form.php:69
 
 
 
 
 
 
 
1646
  msgid "Captcha generation type"
1647
  msgstr ""
1648
 
1649
+ #: options/options-layouts/settings-form.php:74
1650
  msgid "File system"
1651
  msgstr ""
1652
 
1653
+ #: options/options-layouts/settings-form.php:75
1654
  msgid "WP Session"
1655
  msgstr ""
1656
 
1657
+ #: options/options-layouts/settings-form.php:82
1658
  msgid "Enable Quicktags"
1659
  msgstr ""
1660
 
1661
+ #: options/options-layouts/settings-form.php:83
1662
  msgid ""
1663
  "Quicktag is a on-click button that inserts HTML in to comment textarea. For "
1664
  "example the \"b\" Quicktag will insert the HTML bold tags < b > < /b >."
1665
  msgstr ""
1666
 
1667
+ #: options/options-layouts/settings-form.php:92
1668
  msgid "Enable automatic image URL to image HTML conversion"
1669
  msgstr ""
1670
 
1671
+ #: options/options-layouts/settings-form.php:101
1672
  msgid "Allow comment editing for"
1673
  msgstr ""
1674
 
1675
+ #: options/options-layouts/settings-form.php:106
1676
  msgid "Do not allow"
1677
  msgstr ""
1678
 
1679
+ #: options/options-layouts/settings-form.php:107
1680
+ #: options/options-layouts/settings-form.php:108
1681
  #: options/options-layouts/settings-live-update.php:53
1682
  #: options/options-layouts/settings-live-update.php:54
1683
  #: options/options-layouts/settings-live-update.php:55
1684
  msgid "Minutes"
1685
  msgstr ""
1686
 
1687
+ #: options/options-layouts/settings-form.php:109
1688
  #: options/phrases-layouts/phrases-datetime.php:35
1689
  msgid "Hour"
1690
  msgstr ""
1691
 
1692
+ #: options/options-layouts/settings-form.php:110
1693
+ #: options/options-layouts/settings-form.php:111
1694
  msgid "Hours"
1695
  msgstr ""
1696
 
1697
+ #: options/options-layouts/settings-form.php:112
1698
  msgid "Unlimit"
1699
  msgstr ""
1700
 
2357
  msgid "Email Template Phrases"
2358
  msgstr ""
2359
 
2360
+ #: options/phrases-layouts/phrases-email.php:22
2361
  msgid "Email Notification Subject on New Comment"
2362
  msgstr ""
2363
 
2364
+ #: options/phrases-layouts/phrases-email.php:23
2365
+ #: options/phrases-layouts/phrases-email.php:34
2366
+ #: options/phrases-layouts/phrases-email.php:51
2367
+ #: options/phrases-layouts/phrases-email.php:62
2368
+ #: options/phrases-layouts/phrases-email.php:95
2369
+ #: options/phrases-layouts/phrases-email.php:106
2370
+ #: options/phrases-layouts/phrases-email.php:120
2371
+ #: options/phrases-layouts/phrases-email.php:132
2372
+ msgid "Available shortcodes"
2373
  msgstr ""
2374
 
2375
+ #: options/phrases-layouts/phrases-email.php:33
2376
+ msgid "Email Notification on New Comment"
 
 
 
2377
  msgstr ""
2378
 
2379
+ #: options/phrases-layouts/phrases-email.php:50
2380
  msgid "Email Notification Subject on New Reply"
2381
  msgstr ""
2382
 
2383
+ #: options/phrases-layouts/phrases-email.php:61
2384
  msgid "Email Notification on New Reply"
2385
  msgstr ""
2386
 
2387
+ #: options/phrases-layouts/phrases-email.php:81
2388
  msgid "Ignore subscription"
2389
  msgstr ""
2390
 
2391
+ #: options/phrases-layouts/phrases-email.php:94
2392
  msgid "Subscribe confirmation email subject"
2393
  msgstr ""
2394
 
2395
+ #: options/phrases-layouts/phrases-email.php:105
2396
  msgid "Subscribe confirmation email content"
2397
  msgstr ""
2398
 
2399
+ #: options/phrases-layouts/phrases-email.php:119
2400
  msgid "Comment approved subject"
2401
  msgstr ""
2402
 
2403
+ #: options/phrases-layouts/phrases-email.php:130
2404
  msgid "Comment approved message"
2405
  msgstr ""
2406
 
2568
  msgid "Message if commenting disabled by user role"
2569
  msgstr ""
2570
 
2571
+ #: options/tools-layouts/options-export.php:9
2572
  msgid ""
2573
+ "Using this tool you can migrate or backup/restore wpDiscuz options from one "
2574
+ "WordPress to another."
2575
+ msgstr ""
2576
+
2577
+ #: options/tools-layouts/options-export.php:20
2578
+ msgid "Download Options"
2579
+ msgstr ""
2580
+
2581
+ #: options/tools-layouts/options-export.php:28
2582
+ msgid "Backup Options"
2583
  msgstr ""
2584
 
2585
  #: options/tools-layouts/options-import.php:9
2586
  msgid ""
2587
+ "Here you can import and restore wpDiscuz options. You just need to choose "
2588
+ "backup file and click import options."
2589
+ msgstr ""
2590
+
2591
+ #: options/tools-layouts/options-import.php:22
2592
+ msgid "Import Options"
2593
+ msgstr ""
2594
+
2595
+ #: options/tools-layouts/subscriptions-import.php:11
2596
+ msgid ""
2597
+ "Using this tool you can import subscriptions from other plugins to wpDiscuz."
2598
+ msgstr ""
2599
+
2600
+ #: options/tools-layouts/subscriptions-import.php:19
2601
+ msgid "Import subscriptions from Subscribe To Comments Reloaded"
2602
+ msgstr ""
2603
+
2604
+ #: options/tools-layouts/subscriptions-import.php:20
2605
+ msgid "Import subscriptions from \"Subscribe To Comments Reloaded\" plugin"
2606
  msgstr ""
2607
 
2608
  #: templates/comment/comment-form.php:78
options/class.WpdiscuzOptions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class WpdiscuzOptions {
4
 
5
  private $optionsSerialized;
6
  private $dbManager;
@@ -44,7 +44,7 @@ class WpdiscuzOptions {
44
  $this->optionsSerialized->shareButtons = isset($_POST['wpdiscuz_share_buttons']) ? $_POST['wpdiscuz_share_buttons'] : array();
45
  $this->optionsSerialized->headerTextShowHide = isset($_POST['wc_header_text_show_hide']) ? $_POST['wc_header_text_show_hide'] : 0;
46
  $this->optionsSerialized->storeCommenterData = isset($_POST['storeCommenterData']) && (intval($_POST['storeCommenterData']) || $_POST['storeCommenterData'] == 0) ? $_POST['storeCommenterData'] : -1;
47
- $this->optionsSerialized->showHideLoggedInUsername = isset($_POST['wc_show_hide_loggedin_username']) ? $_POST['wc_show_hide_loggedin_username'] : 0;
48
  $this->optionsSerialized->authorTitlesShowHide = isset($_POST['wc_author_titles_show_hide']) ? $_POST['wc_author_titles_show_hide'] : 0;
49
  $this->optionsSerialized->simpleCommentDate = isset($_POST['wc_simple_comment_date']) ? $_POST['wc_simple_comment_date'] : 0;
50
  $this->optionsSerialized->subscriptionType = isset($_POST['subscriptionType']) ? $_POST['subscriptionType'] : 1;
@@ -56,7 +56,7 @@ class WpdiscuzOptions {
56
  $this->optionsSerialized->formBGColor = isset($_POST['wc_form_bg_color']) ? $_POST['wc_form_bg_color'] : '#f9f9f9';
57
  $this->optionsSerialized->commentTextSize = isset($_POST['wc_comment_text_size']) ? $_POST['wc_comment_text_size'] : '14px';
58
  $this->optionsSerialized->commentBGColor = isset($_POST['wc_comment_bg_color']) ? $_POST['wc_comment_bg_color'] : '#fefefe';
59
- $this->optionsSerialized->replyBGColor = isset($_POST['wc_reply_bg_color']) ? $_POST['wc_reply_bg_color'] : '#f8f8f8';
60
  $this->optionsSerialized->primaryColor = isset($_POST['wc_comment_username_color']) ? $_POST['wc_comment_username_color'] : '#00B38F';
61
  $this->optionsSerialized->ratingHoverColor = isset($_POST['wc_comment_rating_hover_color']) ? $_POST['wc_comment_rating_hover_color'] : '#FFED85';
62
  $this->optionsSerialized->ratingInactivColor = isset($_POST['wc_comment_rating_inactiv_color']) ? $_POST['wc_comment_rating_inactiv_color'] : '#DDDDDD';
@@ -232,26 +232,52 @@ class WpdiscuzOptions {
232
  }
233
 
234
  public function tools() {
235
- if (isset($_POST['wc_tools_options'])) {
236
 
237
- if (function_exists('current_user_can') && !current_user_can('manage_options')) {
238
- die(_e('Hacker?', 'wpdiscuz'));
239
- }
240
 
241
- if (function_exists('check_admin_referer')) {
242
- check_admin_referer('wc_tools_form');
243
- }
 
 
244
 
245
- if (isset($_POST['wpdiscuz_import_options']) && ($options = trim($_POST['wpdiscuz_import_options'])) && is_serialized($options)) {
246
- $this->dbManager->importOptions($options);
247
- ?>
248
- <script type="text/javascript">
249
- jQuery(document).ready(function () {
250
- location.reload(true)
251
- });
252
- </script>
253
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  }
 
 
255
  }
256
  include_once 'html-tools.php';
257
  }
@@ -346,7 +372,8 @@ class WpdiscuzOptions {
346
  public function addonNote() {
347
 
348
  $lastHash = get_option('wpdiscuz-addon-note-dismissed');
349
- if( !$lastHash ) return false;
 
350
  $lastHashArray = explode(',', $lastHash);
351
  $currentHash = $this->addonHash();
352
  if ($lastHash != $currentHash) {
@@ -359,13 +386,13 @@ class WpdiscuzOptions {
359
  if (in_array($addon['title'], $lastHashArray))
360
  continue;
361
  ?>
362
- <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;"><img src="<?php echo $addon['thumb'] ?>" style="height:40px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none;" /> <a href="<?php echo admin_url('edit-comments.php?page=' . WpdiscuzCore::PAGE_ADDONS) ?>" style="color:#444; text-decoration:none;" title="<?php _e('Go to wpDiscuz Addons subMenu'); ?>"><?php echo $addon['title']; ?></a></div>
363
  <?php
364
  }
365
  ?>
366
  <div style="clear:both;"></div>
367
  </div>
368
- <p>&nbsp;&nbsp;&nbsp;<a href="<?php echo admin_url('edit-comments.php?page=' . WpdiscuzCore::PAGE_ADDONS) ?>"><?php _e('Go to wpDiscuz Addons subMenu'); ?> &raquo;</a></p>
369
  </div>
370
  <?php
371
  }
1
  <?php
2
 
3
+ class WpdiscuzOptions implements WpDiscuzConstants {
4
 
5
  private $optionsSerialized;
6
  private $dbManager;
44
  $this->optionsSerialized->shareButtons = isset($_POST['wpdiscuz_share_buttons']) ? $_POST['wpdiscuz_share_buttons'] : array();
45
  $this->optionsSerialized->headerTextShowHide = isset($_POST['wc_header_text_show_hide']) ? $_POST['wc_header_text_show_hide'] : 0;
46
  $this->optionsSerialized->storeCommenterData = isset($_POST['storeCommenterData']) && (intval($_POST['storeCommenterData']) || $_POST['storeCommenterData'] == 0) ? $_POST['storeCommenterData'] : -1;
47
+ $this->optionsSerialized->showHideLoggedInUsername = isset($_POST['wc_show_hide_loggedin_username']) ? $_POST['wc_show_hide_loggedin_username'] : 0;
48
  $this->optionsSerialized->authorTitlesShowHide = isset($_POST['wc_author_titles_show_hide']) ? $_POST['wc_author_titles_show_hide'] : 0;
49
  $this->optionsSerialized->simpleCommentDate = isset($_POST['wc_simple_comment_date']) ? $_POST['wc_simple_comment_date'] : 0;
50
  $this->optionsSerialized->subscriptionType = isset($_POST['subscriptionType']) ? $_POST['subscriptionType'] : 1;
56
  $this->optionsSerialized->formBGColor = isset($_POST['wc_form_bg_color']) ? $_POST['wc_form_bg_color'] : '#f9f9f9';
57
  $this->optionsSerialized->commentTextSize = isset($_POST['wc_comment_text_size']) ? $_POST['wc_comment_text_size'] : '14px';
58
  $this->optionsSerialized->commentBGColor = isset($_POST['wc_comment_bg_color']) ? $_POST['wc_comment_bg_color'] : '#fefefe';
59
+ $this->optionsSerialized->replyBGColor = isset($_POST['wc_reply_bg_color']) ? $_POST['wc_reply_bg_color'] : '#f8f8f8';
60
  $this->optionsSerialized->primaryColor = isset($_POST['wc_comment_username_color']) ? $_POST['wc_comment_username_color'] : '#00B38F';
61
  $this->optionsSerialized->ratingHoverColor = isset($_POST['wc_comment_rating_hover_color']) ? $_POST['wc_comment_rating_hover_color'] : '#FFED85';
62
  $this->optionsSerialized->ratingInactivColor = isset($_POST['wc_comment_rating_inactiv_color']) ? $_POST['wc_comment_rating_inactiv_color'] : '#DDDDDD';
232
  }
233
 
234
  public function tools() {
235
+ if (current_user_can('manage_options')) {
236
 
237
+ $wpUploadsDir = wp_upload_dir();
238
+ $wpdiscuzOptionsDir = $wpUploadsDir['basedir'] . self::OPTIONS_DIR;
239
+ $wpdiscuzOptionsUrl = $wpUploadsDir['baseurl'] . self::OPTIONS_DIR;
240
 
241
+ if (isset($_POST['tools-action'])) {
242
+
243
+ $action = $_POST['tools-action'];
244
+
245
+ if ($action == 'export-options') {
246
 
247
+ check_admin_referer('wc_tools_form');
248
+
249
+ wp_mkdir_p($wpdiscuzOptionsDir);
250
+ $options = @maybe_unserialize(get_option(self::OPTION_SLUG_OPTIONS));
251
+ if ($options) {
252
+ $json = json_encode($options);
253
+ if (file_put_contents($wpdiscuzOptionsDir . self::OPTIONS_FILENAME . '.txt', $json)) {
254
+ add_settings_error('wpdiscuz', 'settings_updated', __('Options were backed up!', 'wpdiscuz'), 'updated');
255
+ } else {
256
+ add_settings_error('wpdiscuz', 'settings_updated', __('Cannot back up the options!', 'wpdiscuz'), 'error');
257
+ }
258
+ }
259
+ } else if ($action == 'import-options') {
260
+ check_admin_referer('wc_tools_form');
261
+ $file = isset($_FILES['wpdiscuz-options-file']) ? $_FILES['wpdiscuz-options-file'] : "";
262
+ if ($file && is_array($file) && isset($file['tmp_name'])) {
263
+ if ($data = file_get_contents($file['tmp_name'])) {
264
+ $options = json_decode($data, true);
265
+ if ($options && is_array($options)) {
266
+ update_option(self::OPTION_SLUG_OPTIONS, @maybe_serialize($options));
267
+ add_settings_error('wpdiscuz', 'settings_updated', __('Options Imported Successfully!', 'wpdiscuz'), 'updated');
268
+ } else {
269
+ add_settings_error('wpdiscuz', 'settings_error', __('Error occured! File content is empty or data is not valid!', 'wpdiscuz'), 'error');
270
+ }
271
+ } else {
272
+ add_settings_error('wpdiscuz', 'settings_error', __('Error occured! Can not get file content!', 'wpdiscuz'), 'error');
273
+ }
274
+ } else {
275
+ add_settings_error('wpdiscuz', 'settings_error', __('Error occured! Please choose file!', 'wpdiscuz'), 'error');
276
+ }
277
+ }
278
  }
279
+ } else {
280
+ die(_e('Hacker?', 'wpdiscuz'));
281
  }
282
  include_once 'html-tools.php';
283
  }
372
  public function addonNote() {
373
 
374
  $lastHash = get_option('wpdiscuz-addon-note-dismissed');
375
+ if (!$lastHash)
376
+ return false;
377
  $lastHashArray = explode(',', $lastHash);
378
  $currentHash = $this->addonHash();
379
  if ($lastHash != $currentHash) {
386
  if (in_array($addon['title'], $lastHashArray))
387
  continue;
388
  ?>
389
+ <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;"><img src="<?php echo $addon['thumb'] ?>" style="height:40px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none;" /> <a href="<?php echo admin_url('edit-comments.php?page=' . self::PAGE_ADDONS) ?>" style="color:#444; text-decoration:none;" title="<?php _e('Go to wpDiscuz Addons subMenu'); ?>"><?php echo $addon['title']; ?></a></div>
390
  <?php
391
  }
392
  ?>
393
  <div style="clear:both;"></div>
394
  </div>
395
+ <p>&nbsp;&nbsp;&nbsp;<a href="<?php echo admin_url('edit-comments.php?page=' . self::PAGE_ADDONS) ?>"><?php _e('Go to wpDiscuz Addons subMenu'); ?> &raquo;</a></p>
396
  </div>
397
  <?php
398
  }
options/class.WpdiscuzOptionsSerialized.php CHANGED
@@ -612,7 +612,7 @@ class WpdiscuzOptionsSerialized implements WpDiscuzConstants {
612
  $this->commentTextSize = isset($options['wc_comment_text_size']) ? $options['wc_comment_text_size'] : '14px';
613
  $this->formBGColor = isset($options['wc_form_bg_color']) ? $options['wc_form_bg_color'] : '#F9F9F9';
614
  $this->commentBGColor = isset($options['wc_comment_bg_color']) ? $options['wc_comment_bg_color'] : '#FEFEFE';
615
- $this->replyBGColor = isset($options['wc_reply_bg_color']) ? $options['wc_reply_bg_color'] : '#F8F8F8';
616
  $this->primaryColor = isset($options['wc_comment_username_color']) ? $options['wc_comment_username_color'] : '#00B38F';
617
  $this->ratingHoverColor = isset($options['wc_comment_rating_hover_color']) ? $options['wc_comment_rating_hover_color'] : '#FFED85';
618
  $this->ratingInactivColor = isset($options['wc_comment_rating_inactiv_color']) ? $options['wc_comment_rating_inactiv_color'] : '#DDDDDD';
@@ -987,7 +987,11 @@ class WpdiscuzOptionsSerialized implements WpDiscuzConstants {
987
  $js_options['facebookAppID'] = $this->facebookAppID;
988
  $js_options['cookiehash'] = COOKIEHASH;
989
  $js_options['isLoadOnlyParentComments'] = $this->isLoadOnlyParentComments;
990
-
 
 
 
 
991
  return $js_options;
992
  }
993
 
612
  $this->commentTextSize = isset($options['wc_comment_text_size']) ? $options['wc_comment_text_size'] : '14px';
613
  $this->formBGColor = isset($options['wc_form_bg_color']) ? $options['wc_form_bg_color'] : '#F9F9F9';
614
  $this->commentBGColor = isset($options['wc_comment_bg_color']) ? $options['wc_comment_bg_color'] : '#FEFEFE';
615
+ $this->replyBGColor = isset($options['wc_reply_bg_color']) ? $options['wc_reply_bg_color'] : '#F8F8F8';
616
  $this->primaryColor = isset($options['wc_comment_username_color']) ? $options['wc_comment_username_color'] : '#00B38F';
617
  $this->ratingHoverColor = isset($options['wc_comment_rating_hover_color']) ? $options['wc_comment_rating_hover_color'] : '#FFED85';
618
  $this->ratingInactivColor = isset($options['wc_comment_rating_inactiv_color']) ? $options['wc_comment_rating_inactiv_color'] : '#DDDDDD';
987
  $js_options['facebookAppID'] = $this->facebookAppID;
988
  $js_options['cookiehash'] = COOKIEHASH;
989
  $js_options['isLoadOnlyParentComments'] = $this->isLoadOnlyParentComments;
990
+ if (!($antispamKey = get_transient(self::OPTION_SLUG_ANTISPAM))) {
991
+ $antispamKey = md5(time() . uniqid());
992
+ set_transient(self::OPTION_SLUG_ANTISPAM, $antispamKey, DAY_IN_SECONDS);
993
+ }
994
+ $js_options['antispamKey'] = $antispamKey;
995
  return $js_options;
996
  }
997
 
options/html-tools.php CHANGED
@@ -9,58 +9,40 @@ if (!defined('ABSPATH')) {
9
  </div>
10
  <h1 style="padding-bottom:20px; padding-top:15px;"><?php _e('wpDiscuz Tools', 'wpdiscuz'); ?></h1>
11
  <br style="clear:both" />
12
-
13
-
14
- <form action="<?php echo admin_url(); ?>edit-comments.php?page=<?php echo WpdiscuzCore::PAGE_TOOLS; ?>" method="post" name="<?php echo WpdiscuzCore::PAGE_SETTINGS; ?>" class="wc-tools-settings-form wc-form">
15
- <?php
16
- if (function_exists('wp_nonce_field')) {
17
- wp_nonce_field('wc_tools_form');
18
- }
19
- ?>
20
- <div id="toolsTab">
21
- <ul class="resp-tabs-list tools_tab_id">
22
- <li><?php _e('Export options', 'wpdiscuz'); ?></li>
23
- <li><?php _e('Import options', 'wpdiscuz'); ?></li>
24
- </ul>
25
- <div class="resp-tabs-container tools_tab_id">
26
- <?php
27
- include 'tools-layouts/options-export.php';
28
- include 'tools-layouts/options-import.php';
29
- ?>
30
- </div>
31
  </div>
32
- <script>
33
- jQuery(document).ready(function ($) {
34
- var width = 0;
35
- var toolsTabsType = 'default';
36
- $('#toolsTab ul.resp-tabs-list.tools_tab_id li').each(function () {
37
- width += $(this).outerWidth(true);
38
- });
 
39
 
40
- if (width > $('#toolsTab').innerWidth()) {
41
- toolsTabsType = 'vertical';
42
- }
43
 
44
- //Horizontal Tab
45
- $('#toolsTab').wpdiscuzEasyResponsiveTabs({
46
- type: toolsTabsType, //Types: default, vertical, accordion
47
- width: 'auto', //auto or any width like 600px
48
- fit: true, // 100% fit in a container
49
- tabidentify: 'tools_tab_id' // The tab groups identifier
50
- });
51
  });
52
- </script>
53
- <table class="form-table wc-form-table">
54
- <tbody>
55
- <tr valign="top">
56
- <td colspan="4">
57
- <p class="submit">
58
- <input style="float: right;" type="submit" class="button button-primary" name="wc_tools_options" value="<?php _e('Save Changes', 'wpdiscuz'); ?>" />
59
- </p>
60
- </td>
61
- </tr>
62
- </tbody>
63
- </table>
64
- <input type="hidden" name="action" value="update" />
65
- </form>
66
  </div>
9
  </div>
10
  <h1 style="padding-bottom:20px; padding-top:15px;"><?php _e('wpDiscuz Tools', 'wpdiscuz'); ?></h1>
11
  <br style="clear:both" />
12
+ <?php settings_errors('wpdiscuz'); ?>
13
+ <div id="toolsTab">
14
+ <ul class="resp-tabs-list tools_tab_id">
15
+ <li><?php _e('Export options', 'wpdiscuz'); ?></li>
16
+ <li><?php _e('Import options', 'wpdiscuz'); ?></li>
17
+ <li><?php _e('Import subscriptions', 'wpdiscuz'); ?></li>
18
+ </ul>
19
+ <div class="resp-tabs-container tools_tab_id">
20
+ <?php
21
+ include 'tools-layouts/options-export.php';
22
+ include 'tools-layouts/options-import.php';
23
+ include 'tools-layouts/subscriptions-import.php';
24
+ ?>
 
 
 
 
 
 
25
  </div>
26
+ </div>
27
+ <script>
28
+ jQuery(document).ready(function ($) {
29
+ var width = 0;
30
+ var toolsTabsType = 'default';
31
+ $('#toolsTab ul.resp-tabs-list.tools_tab_id li').each(function () {
32
+ width += $(this).outerWidth(true);
33
+ });
34
 
35
+ if (width > $('#toolsTab').innerWidth()) {
36
+ toolsTabsType = 'vertical';
37
+ }
38
 
39
+ //Horizontal Tab
40
+ $('#toolsTab').wpdiscuzEasyResponsiveTabs({
41
+ type: toolsTabsType, //Types: default, vertical, accordion
42
+ width: 'auto', //auto or any width like 600px
43
+ fit: true, // 100% fit in a container
44
+ tabidentify: 'tools_tab_id' // The tab groups identifier
 
45
  });
46
+ });
47
+ </script>
 
 
 
 
 
 
 
 
 
 
 
 
48
  </div>
options/options-layouts/settings-form.php CHANGED
@@ -64,17 +64,6 @@ if (!defined('ABSPATH')) {
64
  </span>
65
  </td>
66
  </tr>
67
- <?php
68
- $pathToDir = WPDISCUZ_DIR_PATH . WPDISCUZ_DS . 'utils' . WPDISCUZ_DS . 'temp';
69
- $isWritable = @is_writable($pathToDir);
70
- if ($isWritable) {
71
- $disableCaptcha = '';
72
- $msg = '';
73
- } else {
74
- $disableCaptcha = 'disabled="disabled"';
75
- $msg = '<p style="display: inline;">' . __('The plugin captcha directory is not writable! Please set writable permissions on "wpdiscuz/utils/temp" directory in order to use the first type of captcha generation', 'wpdiscuz') . '</p>';
76
- }
77
- ?>
78
  <tr valign="top">
79
  <th scope="row">
80
  <label><?php _e('Captcha generation type', 'wpdiscuz'); ?></label>
@@ -82,7 +71,7 @@ if (!defined('ABSPATH')) {
82
  <th>
83
  <?php $isCaptchaInSession = isset($this->optionsSerialized->isCaptchaInSession) ? $this->optionsSerialized->isCaptchaInSession : 0; ?>
84
  <div class="wpd-switch-field">
85
- <input <?php echo $disableCaptcha; ?> type="radio" value="0" <?php checked('0' == $isCaptchaInSession); ?> name="isCaptchaInSession" id="captchaByImageFile" /><label for="captchaByImageFile"><?php _e('File system', 'wpdiscuz') ?></label> &nbsp;
86
  <input type="radio" value="1" <?php checked('1' == $isCaptchaInSession); ?> name="isCaptchaInSession" id="captchaInSession" /><label for="captchaInSession"><?php _e('WP Session', 'wpdiscuz') ?></label>
87
  </div>
88
 
64
  </span>
65
  </td>
66
  </tr>
 
 
 
 
 
 
 
 
 
 
 
67
  <tr valign="top">
68
  <th scope="row">
69
  <label><?php _e('Captcha generation type', 'wpdiscuz'); ?></label>
71
  <th>
72
  <?php $isCaptchaInSession = isset($this->optionsSerialized->isCaptchaInSession) ? $this->optionsSerialized->isCaptchaInSession : 0; ?>
73
  <div class="wpd-switch-field">
74
+ <input type="radio" value="0" <?php checked('0' == $isCaptchaInSession); ?> name="isCaptchaInSession" id="captchaByImageFile" /><label for="captchaByImageFile"><?php _e('File system', 'wpdiscuz') ?></label> &nbsp;
75
  <input type="radio" value="1" <?php checked('1' == $isCaptchaInSession); ?> name="isCaptchaInSession" id="captchaInSession" /><label for="captchaInSession"><?php _e('WP Session', 'wpdiscuz') ?></label>
76
  </div>
77
 
options/phrases-layouts/phrases-email.php CHANGED
@@ -4,58 +4,72 @@ if (!defined('ABSPATH')) {
4
  }
5
  ?>
6
  <style>
7
- p.wpd-desc, .wc_available_variable {
8
- font-size: 13px;
9
- color: #666666;
10
- width: 80%;
11
- padding: 0px;
12
- margin: 0px;
13
- line-height: 18px;
14
- }
15
  </style>
16
  <div>
17
  <h2 style="padding:5px 10px 10px 10px; margin:0px;"><?php _e('Email Template Phrases', 'wpdiscuz'); ?></h2>
18
  <table class="wp-list-table widefat plugins" style="margin-top:10px; border:none;">
19
  <tbody>
20
- <tr valign="top">
21
- <th scope="row"><label for="wc_email_subject"><?php _e('Email Notification Subject on New Comment', 'wpdiscuz'); ?></label></th>
22
- <td colspan="3"><input type="text" value="<?php echo $this->optionsSerialized->phrases['wc_email_subject']; ?>" name="wc_email_subject" id="wc_email_subject" /></td>
23
- </tr>
24
  <tr valign="top">
25
  <th scope="row">
26
- <label for="wc_email_message"><?php _e('Email Notification on New Comment', 'wpdiscuz'); ?></label>
27
  <p class="wpd-desc"><?php _e('Available shortcodes', 'wpdiscuz'); ?>:
28
- <div class="wc_available_variables">
29
- <div class="wc_available_variable">[SITE_URL]</div>
30
- <div class="wc_available_variable">[POST_URL]</div>
31
- <div class="wc_available_variable">[BLOG_TITLE]</div>
32
- <div class="wc_available_variable">[POST_TITLE]</div>
33
- <div class="wc_available_variable">[COMMENT_URL]</div>
34
- <div class="wc_available_variable">[COMMENT_AUTHOR]</div>
35
- <div class="wc_available_variable">[COMMENT_CONTENT]</div>
36
- </div>
37
- </p>
 
 
 
 
 
 
 
 
 
 
 
38
  </th>
39
  <td colspan="3"><textarea name="wc_email_message" id="wc_email_message" style="height: 120px; width:90%;"><?php echo $this->optionsSerialized->phrases['wc_email_message']; ?></textarea></td>
40
  </tr>
41
  <tr valign="top">
42
- <th scope="row"><label for="wc_new_reply_email_subject"><?php _e('Email Notification Subject on New Reply', 'wpdiscuz'); ?></label></th>
43
- <td colspan="3"><input type="text" value="<?php echo $this->optionsSerialized->phrases['wc_new_reply_email_subject']; ?>" name="wc_new_reply_email_subject" id="wc_new_reply_email_subject" /></td>
 
 
 
 
 
 
 
44
  </tr>
45
  <tr valign="top">
46
  <th scope="row">
47
  <label for="wc_new_reply_email_message"><?php _e('Email Notification on New Reply', 'wpdiscuz'); ?></label>
48
  <p class="wpd-desc"><?php _e('Available shortcodes', 'wpdiscuz'); ?>:
49
- <div class="wc_available_variables">
50
- <div class="wc_available_variable">[SITE_URL]</div>
51
- <div class="wc_available_variable">[POST_URL]</div>
52
- <div class="wc_available_variable">[BLOG_TITLE]</div>
53
- <div class="wc_available_variable">[POST_TITLE]</div>
54
- <div class="wc_available_variable">[COMMENT_URL]</div>
55
- <div class="wc_available_variable">[COMMENT_AUTHOR]</div>
56
- <div class="wc_available_variable">[COMMENT_CONTENT]</div>
57
- </div>
58
- </p>
59
  </th>
60
  <td colspan="3"><textarea name="wc_new_reply_email_message" id="wc_new_reply_email_message" style="height: 120px; width:90%;"><?php echo $this->optionsSerialized->phrases['wc_new_reply_email_message']; ?></textarea></td>
61
  </tr>
@@ -76,42 +90,56 @@ p.wpd-desc, .wc_available_variable {
76
  <td colspan="3"><textarea name="wc_comfirm_success_message" id="wc_comfirm_success_message"><?php echo $this->optionsSerialized->phrases['wc_comfirm_success_message']; ?></textarea></td>
77
  </tr>
78
  <tr valign="top">
79
- <th scope="row"><label for="wc_confirm_email_subject"><?php _e('Subscribe confirmation email subject', 'wpdiscuz'); ?></label></th>
80
- <td colspan="3"><input type="text" name="wc_confirm_email_subject" id="wc_confirm_email_subject" value="<?php echo $this->optionsSerialized->phrases['wc_confirm_email_subject']; ?>" /></td>
 
 
 
 
 
 
 
81
  </tr>
82
  <tr valign="top">
83
  <th scope="row">
84
  <label for="wc_confirm_email_message"><?php _e('Subscribe confirmation email content', 'wpdiscuz'); ?></label>
85
- <p class="wpd-desc"><?php _e('Available shortcodes', 'wpdiscuz'); ?>:
86
- <div class="wc_available_variables">
87
- <div class="wc_available_variable">[SITE_URL]</div>
88
- <div class="wc_available_variable">[POST_URL]</div>
89
- <div class="wc_available_variable">[BLOG_TITLE]</div>
90
- <div class="wc_available_variable">[POST_TITLE]</div>
91
- </div>
92
- </p>
93
  </th>
94
  <td colspan="3"><textarea name="wc_confirm_email_message" id="wc_confirm_email_message" style="height: 120px; width:90%;"><?php echo $this->optionsSerialized->phrases['wc_confirm_email_message']; ?></textarea></td>
95
  </tr>
96
  <tr valign="top">
97
- <th scope="row"><label for="wc_comment_approved_email_subject"><?php _e('Comment approved subject', 'wpdiscuz'); ?></label></th>
98
- <td colspan="3"><input type="text" name="wc_comment_approved_email_subject" id="wc_comment_approved_email_subject" value="<?php echo $this->optionsSerialized->phrases['wc_comment_approved_email_subject']; ?>" /></td>
 
 
 
 
 
 
 
99
  </tr>
100
  <tr valign="top">
101
  <th scope="row">
102
  <label for="wc_comment_approved_email_message"><?php _e('Comment approved message', 'wpdiscuz'); ?></label>
103
- <p class="wpd-desc">
104
- <?php _e('Available shortcodes', 'wpdiscuz'); ?>:
105
- <div class="wc_available_variables">
106
- <div class="wc_available_variable">[SITE_URL]</div>
107
- <div class="wc_available_variable">[POST_URL]</div>
108
- <div class="wc_available_variable">[BLOG_TITLE]</div>
109
- <div class="wc_available_variable">[POST_TITLE]</div>
110
- <div class="wc_available_variable">[COMMENT_URL]</div>
111
- <div class="wc_available_variable">[COMMENT_AUTHOR]</div>
112
- <div class="wc_available_variable">[COMMENT_CONTENT]</div>
113
- </div>
114
- </p>
115
  </th>
116
  <td colspan="3"><textarea name="wc_comment_approved_email_message" id="wc_comment_approved_email_message" style="height: 120px; width:90%;"><?php echo $this->optionsSerialized->phrases['wc_comment_approved_email_message']; ?></textarea></td>
117
  </tr>
4
  }
5
  ?>
6
  <style>
7
+ p.wpd-desc, .wc_available_variable {
8
+ font-size: 13px;
9
+ color: #666666;
10
+ width: 80%;
11
+ padding: 0px;
12
+ margin: 0px;
13
+ line-height: 18px;
14
+ }
15
  </style>
16
  <div>
17
  <h2 style="padding:5px 10px 10px 10px; margin:0px;"><?php _e('Email Template Phrases', 'wpdiscuz'); ?></h2>
18
  <table class="wp-list-table widefat plugins" style="margin-top:10px; border:none;">
19
  <tbody>
 
 
 
 
20
  <tr valign="top">
21
  <th scope="row">
22
+ <label for="wc_email_subject"><?php _e('Email Notification Subject on New Comment', 'wpdiscuz'); ?></label>
23
  <p class="wpd-desc"><?php _e('Available shortcodes', 'wpdiscuz'); ?>:
24
+ <div class="wc_available_variables">
25
+ <div class="wc_available_variable">[BLOG_TITLE]</div>
26
+ <div class="wc_available_variable">[POST_TITLE]</div>
27
+ </div>
28
+ </th>
29
+ <td colspan="3"><input type="text" value="<?php echo $this->optionsSerialized->phrases['wc_email_subject']; ?>" name="wc_email_subject" id="wc_email_subject" /></td>
30
+ </tr>
31
+ <tr valign="top">
32
+ <th scope="row">
33
+ <label for="wc_email_message"><?php _e('Email Notification on New Comment', 'wpdiscuz'); ?></label>
34
+ <p class="wpd-desc"><?php _e('Available shortcodes', 'wpdiscuz'); ?>:
35
+ <div class="wc_available_variables">
36
+ <div class="wc_available_variable">[SITE_URL]</div>
37
+ <div class="wc_available_variable">[POST_URL]</div>
38
+ <div class="wc_available_variable">[BLOG_TITLE]</div>
39
+ <div class="wc_available_variable">[POST_TITLE]</div>
40
+ <div class="wc_available_variable">[COMMENT_URL]</div>
41
+ <div class="wc_available_variable">[COMMENT_AUTHOR]</div>
42
+ <div class="wc_available_variable">[COMMENT_CONTENT]</div>
43
+ </div>
44
+ </p>
45
  </th>
46
  <td colspan="3"><textarea name="wc_email_message" id="wc_email_message" style="height: 120px; width:90%;"><?php echo $this->optionsSerialized->phrases['wc_email_message']; ?></textarea></td>
47
  </tr>
48
  <tr valign="top">
49
+ <th scope="row">
50
+ <label for="wc_new_reply_email_subject"><?php _e('Email Notification Subject on New Reply', 'wpdiscuz'); ?></label>
51
+ <p class="wpd-desc"><?php _e('Available shortcodes', 'wpdiscuz'); ?>:
52
+ <div class="wc_available_variables">
53
+ <div class="wc_available_variable">[BLOG_TITLE]</div>
54
+ <div class="wc_available_variable">[POST_TITLE]</div>
55
+ </div>
56
+ </th>
57
+ <td colspan="3"><input type="text" value="<?php echo $this->optionsSerialized->phrases['wc_new_reply_email_subject']; ?>" name="wc_new_reply_email_subject" id="wc_new_reply_email_subject" /></td>
58
  </tr>
59
  <tr valign="top">
60
  <th scope="row">
61
  <label for="wc_new_reply_email_message"><?php _e('Email Notification on New Reply', 'wpdiscuz'); ?></label>
62
  <p class="wpd-desc"><?php _e('Available shortcodes', 'wpdiscuz'); ?>:
63
+ <div class="wc_available_variables">
64
+ <div class="wc_available_variable">[SITE_URL]</div>
65
+ <div class="wc_available_variable">[POST_URL]</div>
66
+ <div class="wc_available_variable">[BLOG_TITLE]</div>
67
+ <div class="wc_available_variable">[POST_TITLE]</div>
68
+ <div class="wc_available_variable">[COMMENT_URL]</div>
69
+ <div class="wc_available_variable">[COMMENT_AUTHOR]</div>
70
+ <div class="wc_available_variable">[COMMENT_CONTENT]</div>
71
+ </div>
72
+ </p>
73
  </th>
74
  <td colspan="3"><textarea name="wc_new_reply_email_message" id="wc_new_reply_email_message" style="height: 120px; width:90%;"><?php echo $this->optionsSerialized->phrases['wc_new_reply_email_message']; ?></textarea></td>
75
  </tr>
90
  <td colspan="3"><textarea name="wc_comfirm_success_message" id="wc_comfirm_success_message"><?php echo $this->optionsSerialized->phrases['wc_comfirm_success_message']; ?></textarea></td>
91
  </tr>
92
  <tr valign="top">
93
+ <th scope="row">
94
+ <label for="wc_confirm_email_subject"><?php _e('Subscribe confirmation email subject', 'wpdiscuz'); ?></label>
95
+ <p class="wpd-desc"><?php _e('Available shortcodes', 'wpdiscuz'); ?>:
96
+ <div class="wc_available_variables">
97
+ <div class="wc_available_variable">[BLOG_TITLE]</div>
98
+ <div class="wc_available_variable">[POST_TITLE]</div>
99
+ </div>
100
+ </th>
101
+ <td colspan="3"><input type="text" name="wc_confirm_email_subject" id="wc_confirm_email_subject" value="<?php echo $this->optionsSerialized->phrases['wc_confirm_email_subject']; ?>" /></td>
102
  </tr>
103
  <tr valign="top">
104
  <th scope="row">
105
  <label for="wc_confirm_email_message"><?php _e('Subscribe confirmation email content', 'wpdiscuz'); ?></label>
106
+ <p class="wpd-desc"><?php _e('Available shortcodes', 'wpdiscuz'); ?>:
107
+ <div class="wc_available_variables">
108
+ <div class="wc_available_variable">[SITE_URL]</div>
109
+ <div class="wc_available_variable">[POST_URL]</div>
110
+ <div class="wc_available_variable">[BLOG_TITLE]</div>
111
+ <div class="wc_available_variable">[POST_TITLE]</div>
112
+ </div>
113
+ </p>
114
  </th>
115
  <td colspan="3"><textarea name="wc_confirm_email_message" id="wc_confirm_email_message" style="height: 120px; width:90%;"><?php echo $this->optionsSerialized->phrases['wc_confirm_email_message']; ?></textarea></td>
116
  </tr>
117
  <tr valign="top">
118
+ <th scope="row">
119
+ <label for="wc_comment_approved_email_subject"><?php _e('Comment approved subject', 'wpdiscuz'); ?></label>
120
+ <p class="wpd-desc"><?php _e('Available shortcodes', 'wpdiscuz'); ?>:
121
+ <div class="wc_available_variables">
122
+ <div class="wc_available_variable">[BLOG_TITLE]</div>
123
+ <div class="wc_available_variable">[POST_TITLE]</div>
124
+ </div>
125
+ </th>
126
+ <td colspan="3"><input type="text" name="wc_comment_approved_email_subject" id="wc_comment_approved_email_subject" value="<?php echo $this->optionsSerialized->phrases['wc_comment_approved_email_subject']; ?>" /></td>
127
  </tr>
128
  <tr valign="top">
129
  <th scope="row">
130
  <label for="wc_comment_approved_email_message"><?php _e('Comment approved message', 'wpdiscuz'); ?></label>
131
+ <p class="wpd-desc">
132
+ <?php _e('Available shortcodes', 'wpdiscuz'); ?>:
133
+ <div class="wc_available_variables">
134
+ <div class="wc_available_variable">[SITE_URL]</div>
135
+ <div class="wc_available_variable">[POST_URL]</div>
136
+ <div class="wc_available_variable">[BLOG_TITLE]</div>
137
+ <div class="wc_available_variable">[POST_TITLE]</div>
138
+ <div class="wc_available_variable">[COMMENT_URL]</div>
139
+ <div class="wc_available_variable">[COMMENT_AUTHOR]</div>
140
+ <div class="wc_available_variable">[COMMENT_CONTENT]</div>
141
+ </div>
142
+ </p>
143
  </th>
144
  <td colspan="3"><textarea name="wc_comment_approved_email_message" id="wc_comment_approved_email_message" style="height: 120px; width:90%;"><?php echo $this->optionsSerialized->phrases['wc_comment_approved_email_message']; ?></textarea></td>
145
  </tr>
options/tools-layouts/options-export.php CHANGED
@@ -2,20 +2,34 @@
2
  if (!defined('ABSPATH')) {
3
  exit();
4
  }
5
- $options = maybe_serialize(get_option(WpdiscuzCore::OPTION_SLUG_OPTIONS));
6
  ?>
7
  <div>
8
  <h2 style="padding:5px 10px 10px 10px; margin:0px;"><?php _e('Export options', 'wpdiscuz'); ?></h2>
9
  <p style="font-size:13px; color:#999999; width:90%; padding-left:0px; margin-left:10px;">
10
- <?php _e('You can transfer the saved options data between different installs by copying the text inside this textarea. To import data from another install, navigate to "Import Options" Tab and put the data in textarea with the one from another install and click "Save Changes". Make sure you use the same wpDiscuz versions.', 'wpdiscuz'); ?>
11
  </p>
12
- <table class="wp-list-table widefat plugins" style="margin-top:10px; border:none;">
13
- <tbody>
14
- <tr>
15
- <td>
16
- <textarea class="wpdiscuz_export_options" name="wpdiscuz_export_options" rows="15"><?php print_r($options); ?></textarea>
17
- </td>
18
- </tr>
19
- </tbody>
20
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  </div>
2
  if (!defined('ABSPATH')) {
3
  exit();
4
  }
 
5
  ?>
6
  <div>
7
  <h2 style="padding:5px 10px 10px 10px; margin:0px;"><?php _e('Export options', 'wpdiscuz'); ?></h2>
8
  <p style="font-size:13px; color:#999999; width:90%; padding-left:0px; margin-left:10px;">
9
+ <?php _e('Using this tool you can migrate or backup/restore wpDiscuz options from one WordPress to another.', 'wpdiscuz'); ?>
10
  </p>
11
+ <form action="" method="post" class="wc-tools-settings-form wc-form">
12
+ <?php wp_nonce_field('wc_tools_form'); ?>
13
+ <table class="wp-list-table widefat plugins" style="margin-top:10px; border:none;">
14
+ <tbody>
15
+ <?php if (file_exists($wpdiscuzOptionsDir . self::OPTIONS_FILENAME . '.txt')) { ?>
16
+ <tr>
17
+ <td>
18
+ <div class="wpdiscuz-option-download">
19
+ <a href="<?php echo $wpdiscuzOptionsUrl . self::OPTIONS_FILENAME . '.txt'; ?>" download="<?php echo self::OPTIONS_FILENAME . '.txt'; ?>" class="button button-secondary">
20
+ <?php _e('Download Options', 'wpdiscuz'); ?>
21
+ </a>
22
+ </div>
23
+ </td>
24
+ </tr>
25
+ <?php } ?>
26
+ <tr>
27
+ <td style="text-align:right;">
28
+ <input type="submit" name="wpdiscuz-export-submit" class="button button-primary" value="<?php _e('Backup Options', 'wpdiscuz'); ?>">
29
+ <input type="hidden" name="tools-action" value="export-options" />
30
+ </td>
31
+ </tr>
32
+ </tbody>
33
+ </table>
34
+ </form>
35
  </div>
options/tools-layouts/options-import.php CHANGED
@@ -6,15 +6,24 @@ if (!defined('ABSPATH')) {
6
  <div>
7
  <h2 style="padding:5px 10px 10px 10px; margin:0px;"><?php _e('Import options', 'wpdiscuz'); ?></h2>
8
  <p style="font-size:13px; color:#999999; width:90%; padding-left:0px; margin-left:10px;">
9
- <?php _e('You can transfer the saved options data between different installs by copying the text inside this textarea in "Export Options" Tab. To import data from another install, just put the data in textarea with the one from another install and click "Save Changes". Make sure you use the same wpDiscuz versions.', 'wpdiscuz'); ?>
10
  </p>
11
- <table class="wp-list-table widefat plugins" style="margin-top:10px; border:none;">
12
- <tbody>
13
- <tr>
14
- <td>
15
- <textarea class="wpdiscuz_import_options" name="wpdiscuz_import_options" rows="15"></textarea>
16
- </td>
17
- </tr>
18
- </tbody>
19
- </table>
 
 
 
 
 
 
 
 
 
20
  </div>
6
  <div>
7
  <h2 style="padding:5px 10px 10px 10px; margin:0px;"><?php _e('Import options', 'wpdiscuz'); ?></h2>
8
  <p style="font-size:13px; color:#999999; width:90%; padding-left:0px; margin-left:10px;">
9
+ <?php _e('Here you can import and restore wpDiscuz options. You just need to choose backup file and click import options.', 'wpdiscuz'); ?>
10
  </p>
11
+ <form action="" method="post" class="wc-tools-settings-form wc-form" enctype="multipart/form-data">
12
+ <?php wp_nonce_field('wc_tools_form'); ?>
13
+ <table class="wp-list-table widefat plugins" style="margin-top:10px; border:none;">
14
+ <tbody>
15
+ <tr>
16
+ <td>
17
+ <input type="file" name="wpdiscuz-options-file" class=""/>
18
+ </td>
19
+ </tr>
20
+ <tr>
21
+ <td style="text-align:right;">
22
+ <input type="submit" name="wpdiscuz-import-submit" class="button button-primary" value="<?php _e('Import Options', 'wpdiscuz'); ?>">
23
+ <input type="hidden" name="tools-action" value="import-options" />
24
+ </td>
25
+ </tr>
26
+ </tbody>
27
+ </table>
28
+ </form>
29
  </div>
options/tools-layouts/subscriptions-import.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ exit();
4
+ }
5
+ $stcrSubscriptionsCount = intval($this->dbManager->getStcrAllSubscriptions());
6
+ $disabled = $stcrSubscriptionsCount ? '' : 'disabled="disabled"';
7
+ ?>
8
+ <div>
9
+ <h2 style="padding:5px 10px 10px 10px; margin:0px;"><?php _e('Import subscriptions', 'wpdiscuz'); ?></h2>
10
+ <p style="font-size:13px; color:#999999; width:90%; padding-left:0px; margin-left:10px;">
11
+ <?php _e('Using this tool you can import subscriptions from other plugins to wpDiscuz.', 'wpdiscuz'); ?>
12
+ </p>
13
+ <form action="" method="post" class="wc-tools-settings-form wc-form">
14
+ <?php wp_nonce_field('wc_tools_form'); ?>
15
+ <table class="wp-list-table widefat plugins" style="margin-top:10px; border:none;">
16
+ <tbody>
17
+ <tr>
18
+ <td>
19
+ <button type="submit" class="button button-secondary import-stcr" <?php echo $disabled; ?> title="<?php _e('Import subscriptions from Subscribe To Comments Reloaded', 'wpdiscuz'); ?>">
20
+ <?php _e('Import subscriptions from "Subscribe To Comments Reloaded" plugin', 'wpdiscuz'); ?>&nbsp;
21
+ <i class="fas wc-hidden"></i>
22
+ </button>
23
+ <span class="import-progress">&nbsp;</span>
24
+ <input type="hidden" name="stcr-subscriptions-count" value="<?php echo $stcrSubscriptionsCount; ?>" />
25
+ <input type="hidden" name="stcr-step" value="0" class="stcr-step"/>
26
+ </td>
27
+ </tr>
28
+ </tbody>
29
+ </table>
30
+ </form>
31
+ </div>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: gVectors Team
3
  Tags: comment, comments, ajax comments, custom comment form, custom comment field
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
- Stable tag: 5.0.4
7
  Requires PHP: 5.4 and higher
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -174,17 +174,16 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
174
 
175
  == Changelog ==
176
 
177
- = Comments - wpDiscuz v5.0.3 / v5.0.4 =
178
 
179
- * Added : Font-Awesome lib is updated to version 5
180
- * Added : Option to set child comments order.
181
- * Added : New hooks after sending notification email
182
- - do_action('wpdiscuz_notify_post_subscribers', $postId, $commentId, $subscriberUserId, $subscriberEmail);
183
- - do_action('wpdiscuz_notify_all_comment_subscribers', $postId, $newCommentId, $subscriberUserId, $subscriberEmail);
184
- - do_action('wpdiscuz_notify_comment_subscribers', $parentCommentId, $newCommentId, $subscriberUserId, $subscriberEmail);
185
- * Added : Shortcodes in Emails (Comments > Phrases > Emails)
186
- * Added : New hook for gravatar size - apply_filters('wpdiscuz_gravatar_size', 64);
187
- * Changed: CAPTCHA directory in wp-content/uploads folder to avoid permission issues
188
 
189
 
190
  IMPORTANT!
@@ -198,6 +197,19 @@ IMPORTANT!
198
  - If your server PHP version is lower than 5.4, [please change it to higher](https://wordpress.org/support/topic/wpdiscuz-4-requires-php-5-4-and-higher/)
199
 
200
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  = Comments - wpDiscuz v5.0.2 =
202
 
203
  * Added : Closed Comments
3
  Tags: comment, comments, ajax comments, custom comment form, custom comment field
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
+ Stable tag: 5.0.5
7
  Requires PHP: 5.4 and higher
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
174
 
175
  == Changelog ==
176
 
177
+ = Comments - wpDiscuz v5.0.5 =
178
 
179
+ * Added: Shortcodes for Notification Emails Subject
180
+ * Added: Tool to import subscriptions from "Subscribe To Comments Reloaded" plugin
181
+ * Added: Filter hook to change trackback avatar image `wpdiscuz_avatar_trackback`,
182
+ * Added: Action hook for General Data Protection Regulation (GDPR) checkbox `wpdiscuz_submit_button_before`,
183
+ * Added: Filter hook to manage user labels `wpdiscuz_user_label`
184
+ * Changed: Export / Import wpDiscuz Options using .txt file
185
+ * Fixed Bug: Gravatar cache issue when passed variable is object
186
+ * Fixed Bug: Delete Gravatar cache problem on "cron job" mode.
 
187
 
188
 
189
  IMPORTANT!
197
  - If your server PHP version is lower than 5.4, [please change it to higher](https://wordpress.org/support/topic/wpdiscuz-4-requires-php-5-4-and-higher/)
198
 
199
 
200
+ = Comments - wpDiscuz v5.0.3 / v5.0.4 =
201
+
202
+ * Added : Font-Awesome lib is updated to version 5
203
+ * Added : Option to set child comments order.
204
+ * Added : New hooks after sending notification email
205
+ - do_action('wpdiscuz_notify_post_subscribers', $postId, $commentId, $subscriberUserId, $subscriberEmail);
206
+ - do_action('wpdiscuz_notify_all_comment_subscribers', $postId, $newCommentId, $subscriberUserId, $subscriberEmail);
207
+ - do_action('wpdiscuz_notify_comment_subscribers', $parentCommentId, $newCommentId, $subscriberUserId, $subscriberEmail);
208
+ * Added : Shortcodes in Emails (Comments > Phrases > Emails)
209
+ * Added : New hook for gravatar size - apply_filters('wpdiscuz_gravatar_size', 64);
210
+ * Changed: CAPTCHA directory in wp-content/uploads folder to avoid permission issues
211
+
212
+
213
  = Comments - wpDiscuz v5.0.2 =
214
 
215
  * Added : Closed Comments
templates/comment/class.WpdiscuzWalker.php CHANGED
@@ -123,11 +123,12 @@ class WpdiscuzWalker extends Walker_Comment implements WpDiscuzConstants {
123
  $author_title = $this->optionsSerialized->phrases['wc_blog_role_guest'];
124
  $blogRoles = $this->optionsSerialized->blogRoles;
125
  if ($blogRoles) {
126
- if ($user->roles && is_array($user->roles)) {
127
  foreach ($user->roles as $role) {
128
  if (array_key_exists($role, $blogRoles)) {
129
  $authorClass = 'wc-blog-user wc-blog-' . $role;
130
- $author_title = $this->optionsSerialized->phrases['wc_blog_role_' . $role];
 
131
  break;
132
  }
133
  }
@@ -166,7 +167,7 @@ class WpdiscuzWalker extends Walker_Comment implements WpDiscuzConstants {
166
  $authorName = apply_filters('wpdiscuz_comment_author', $authorName, $comment);
167
  $profileUrl = apply_filters('wpdiscuz_profile_url', $profileUrl, $user);
168
  $authorAvatarField = apply_filters('wpdiscuz_author_avatar_field', $authorAvatarField, $comment, $user, $profileUrl);
169
-
170
  $gravatarSize = apply_filters('wpdiscuz_gravatar_size', 64);
171
  $gravatarArgs = array(
172
  'wpdiscuz_gravatar_field' => $authorAvatarField,
@@ -177,7 +178,7 @@ class WpdiscuzWalker extends Walker_Comment implements WpDiscuzConstants {
177
  $authorAvatar = $this->optionsSerialized->wordpressShowAvatars ? get_avatar($authorAvatarField, $gravatarSize, '', $authorName, $gravatarArgs) : '';
178
  $trackOrPingback = $comment->comment_type == 'pingback' || $comment->comment_type == 'trackback' ? true : false;
179
  if ($trackOrPingback) {
180
- $authorAvatar = '<img class="avatar avatar-' . $gravatarSize . ' photo" width="' . $gravatarSize . '" height="' . $gravatarSize . '" src="' . plugins_url(WPDISCUZ_DIR_NAME . '/assets/img/trackback.png') . '" alt="trackback">';
181
  }
182
 
183
  if ($profileUrl && !$this->optionsSerialized->disableProfileURLs) {
123
  $author_title = $this->optionsSerialized->phrases['wc_blog_role_guest'];
124
  $blogRoles = $this->optionsSerialized->blogRoles;
125
  if ($blogRoles) {
126
+ if ($user->roles && is_array($user->roles)) {
127
  foreach ($user->roles as $role) {
128
  if (array_key_exists($role, $blogRoles)) {
129
  $authorClass = 'wc-blog-user wc-blog-' . $role;
130
+ $rolePhrase = $this->optionsSerialized->phrases['wc_blog_role_' . $role];
131
+ $author_title = apply_filters('wpdiscuz_user_label', $rolePhrase, $user);
132
  break;
133
  }
134
  }
167
  $authorName = apply_filters('wpdiscuz_comment_author', $authorName, $comment);
168
  $profileUrl = apply_filters('wpdiscuz_profile_url', $profileUrl, $user);
169
  $authorAvatarField = apply_filters('wpdiscuz_author_avatar_field', $authorAvatarField, $comment, $user, $profileUrl);
170
+
171
  $gravatarSize = apply_filters('wpdiscuz_gravatar_size', 64);
172
  $gravatarArgs = array(
173
  'wpdiscuz_gravatar_field' => $authorAvatarField,
178
  $authorAvatar = $this->optionsSerialized->wordpressShowAvatars ? get_avatar($authorAvatarField, $gravatarSize, '', $authorName, $gravatarArgs) : '';
179
  $trackOrPingback = $comment->comment_type == 'pingback' || $comment->comment_type == 'trackback' ? true : false;
180
  if ($trackOrPingback) {
181
+ $authorAvatar = '<img class="avatar avatar-' . $gravatarSize . ' photo" width="' . $gravatarSize . '" height="' . $gravatarSize . '" src="' . $args['avatar_trackback'] . '" alt="trackback">';
182
  }
183
 
184
  if ($profileUrl && !$this->optionsSerialized->disableProfileURLs) {
utils/class.WpdiscuzCache.php CHANGED
@@ -1,190 +1,210 @@
1
- <?php
2
-
3
- if (!defined('ABSPATH')) {
4
- exit();
5
- }
6
-
7
- class WpdiscuzCache implements WpDiscuzConstants {
8
-
9
- public $gravatars;
10
- public $wpUploadsDir;
11
- public $doGravatarsCache;
12
- private $avBaseDir;
13
- private $currentTime;
14
- private $timeout;
15
- private $optionsSerialized;
16
- private $helper;
17
- private $dbManager;
18
-
19
- public function __construct($optionsSerialized, $helper, $dbManager) {
20
- $this->optionsSerialized = $optionsSerialized;
21
- $this->helper = $helper;
22
- $this->dbManager = $dbManager;
23
- $this->gravatars = array();
24
- $this->wpUploadsDir = wp_upload_dir();
25
- $this->avBaseDir = $this->wpUploadsDir['basedir'] . self::GRAVATARS_CACHE_DIR;
26
- $this->currentTime = current_time('timestamp');
27
- $this->timeout = $this->optionsSerialized->gravatarCacheTimeout * DAY_IN_SECONDS;
28
- $this->doGravatarsCache = $this->optionsSerialized->isGravatarCacheEnabled && $this->optionsSerialized->isFileFunctionsExists;
29
- if ($this->doGravatarsCache) {
30
- wp_mkdir_p($this->avBaseDir);
31
- add_filter('pre_get_avatar', array(&$this, 'preGetGravatar'), 10, 3);
32
- add_filter('get_avatar', array(&$this, 'getAvatar'), 10, 6);
33
- if ($this->optionsSerialized->gravatarCacheMethod == 'runtime') {
34
- add_filter('get_avatar_url', array(&$this, 'gravatarsRunTime'), 10, 3);
35
- } else {
36
- add_filter('get_avatar_url', array(&$this, 'gravatarsCronJob'), 10, 3);
37
- }
38
- }
39
- add_action('admin_post_purgeExpiredGravatarsCaches', array(&$this, 'purgeExpiredGravatarsCaches'));
40
- add_action('admin_post_purgeGravatarsCaches', array(&$this, 'purgeGravatarsCaches'));
41
- }
42
-
43
- public function preGetGravatar($avatar, $idOrEmail, $args) {
44
- $avatar = $this->getAvatarHtml($avatar, $idOrEmail, $args);
45
- return $avatar;
46
- }
47
-
48
- public function getAvatar($avatar, $idOrEmail, $size, $default, $alt, $args) {
49
- if (strpos($avatar, self::GRAVATARS_CACHE_DIR) === false) {
50
- $avatar = $this->getAvatarHtml($avatar, $idOrEmail, $args);
51
- }
52
- return $avatar;
53
- }
54
-
55
- private function getAvatarHtml($avatar, $idOrEmail, $args) {
56
- if ($idOrEmail && $args &&
57
- isset($args['wpdiscuz_gravatar_field']) &&
58
- $args['wpdiscuz_gravatar_field'] != ''
59
- ) {
60
- $cacheFileUrl = is_ssl() ? str_replace('http://', 'https://', $this->wpUploadsDir['baseurl']) . self::GRAVATARS_CACHE_DIR : $this->wpUploadsDir['baseurl'] . self::GRAVATARS_CACHE_DIR;
61
- $md5FileName = is_object($args['wpdiscuz_gravatar_field']) && isset($args['wpdiscuz_gravatar_field']->comment_author_email) ? md5($args['wpdiscuz_gravatar_field']->comment_author_email) : md5($args['wpdiscuz_gravatar_field']);
62
- $fileNameHash = $md5FileName . '.gif';
63
- $fileDirHash = $this->avBaseDir . $fileNameHash;
64
- if (file_exists($fileDirHash)) {
65
- $fileUrlHash = $cacheFileUrl . $fileNameHash;
66
- $url = $fileUrlHash;
67
- $url2x = $fileUrlHash;
68
- $class = array('avatar', 'avatar-' . (int) $args['size'], 'photo');
69
- if ($args['force_default']) {
70
- $class[] = 'avatar-default';
71
- }
72
-
73
- if ($args['class']) {
74
- if (is_array($args['class'])) {
75
- $class = array_merge($class, $args['class']);
76
- } else {
77
- $class[] = $args['class'];
78
- }
79
- }
80
-
81
- $avatar = sprintf(
82
- "<img alt='%s' src='%s' srcset='%s' class='%s' height='%d' width='%d' %s/>", esc_attr($args['alt']), esc_url($url), esc_attr("$url2x 2x"), esc_attr(join(' ', $class)), (int) $args['height'], (int) $args['width'], $args['extra_attr']
83
- );
84
- }
85
- }
86
- return $avatar;
87
- }
88
-
89
- public function gravatarsRunTime($url, $idOrEmail, $args) {
90
- if ($url && $idOrEmail && $args &&
91
- isset($args['wpdiscuz_gravatar_field']) &&
92
- isset($args['size']) &&
93
- isset($args['wpdiscuz_gravatar_size']) &&
94
- $args['wpdiscuz_gravatar_field'] != '' &&
95
- $args['size'] == $args['wpdiscuz_gravatar_size'] &&
96
- $fileData = @file_get_contents($url)
97
- ) {
98
- $md5FileName = md5($args['wpdiscuz_gravatar_field']);
99
- $fileNameHash = $md5FileName . '.gif';
100
- $cacheFile = $this->avBaseDir . $fileNameHash;
101
- if (@file_put_contents($cacheFile, $fileData)) {
102
- $cacheFileUrl = is_ssl() ? str_replace('http://', 'https://', $this->wpUploadsDir['baseurl']) . self::GRAVATARS_CACHE_DIR : $this->wpUploadsDir['baseurl'] . self::GRAVATARS_CACHE_DIR;
103
- $fileUrlHash = $cacheFileUrl . $fileNameHash;
104
- $url = $fileUrlHash;
105
- $this->gravatars[$md5FileName] = array(
106
- 'user_id' => intval($args['wpdiscuz_gravatar_user_id']),
107
- 'user_email' => trim($args['wpdiscuz_gravatar_user_email']),
108
- 'url' => trim($url),
109
- 'hash' => trim($md5FileName),
110
- 'cached' => 1
111
- );
112
- }
113
- }
114
- return $url;
115
- }
116
-
117
- public function gravatarsCronJob($url, $idOrEmail, $args) {
118
- if ($url && $idOrEmail && $args &&
119
- isset($args['wpdiscuz_gravatar_field']) &&
120
- isset($args['size']) &&
121
- isset($args['wpdiscuz_gravatar_size']) &&
122
- $args['wpdiscuz_gravatar_field'] != '' &&
123
- $args['size'] == $args['wpdiscuz_gravatar_size']
124
- ) {
125
- $md5FileName = md5($args['wpdiscuz_gravatar_field']);
126
- $this->gravatars[$md5FileName] = array(
127
- 'user_id' => intval($args['wpdiscuz_gravatar_user_id']),
128
- 'user_email' => trim($args['wpdiscuz_gravatar_user_email']),
129
- 'url' => trim($url),
130
- 'hash' => trim($md5FileName),
131
- 'cached' => 0
132
- );
133
- }
134
- return $url;
135
- }
136
-
137
- public function cacheGravatars() {
138
- $gravatars = $this->dbManager->getGravatars();
139
- if ($gravatars) {
140
- $cachedIds = array();
141
- foreach ($gravatars as $gravatar) {
142
- $id = $gravatar['id'];
143
- $url = $gravatar['url'];
144
- $hash = $gravatar['hash'];
145
- if ($fileData = @file_get_contents($url)) {
146
- $cacheFile = $this->avBaseDir . $hash . '.gif';
147
- if (@file_put_contents($cacheFile, $fileData)) {
148
- $cachedIds[] = $id;
149
- }
150
- }
151
- }
152
- $this->dbManager->updateGravatarsStatus($cachedIds);
153
- }
154
- }
155
-
156
- public function purgeExpiredGravatarsCaches() {
157
- if (current_user_can('manage_options') && isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'purgeExpiredGravatarsCaches')) {
158
- $timeFrame = $this->optionsSerialized->gravatarCacheTimeout * DAY_IN_SECONDS;
159
- $expiredGravatars = $this->dbManager->getExpiredGravatars($timeFrame);
160
- if ($expiredGravatars) {
161
- $files = function_exists('scandir') ? scandir($this->avBaseDir) : false;
162
- if ($files) {
163
- foreach ($files as $file) {
164
- if (in_array($file, $expiredGravatars)) {
165
- @unlink($this->avBaseDir . $file);
166
- }
167
- }
168
- }
169
- $this->dbManager->deleteExpiredGravatars($timeFrame);
170
- }
171
- }
172
- wp_redirect(admin_url('edit-comments.php?page=' . WpdiscuzCore::PAGE_SETTINGS));
173
- }
174
-
175
- public function purgeGravatarsCaches() {
176
- if (current_user_can('manage_options') && isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'purgeGravatarsCaches')) {
177
- $files = function_exists('scandir') ? scandir($this->avBaseDir) : false;
178
- if ($files) {
179
- foreach ($files as $file) {
180
- if ($file != '.' && $file != '..' && $file != '.htaccess') {
181
- @unlink($this->avBaseDir . $file);
182
- }
183
- }
184
- }
185
- $this->dbManager->deleteGravatars();
186
- }
187
- wp_redirect(admin_url('edit-comments.php?page=' . WpdiscuzCore::PAGE_SETTINGS));
188
- }
189
-
190
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) {
4
+ exit();
5
+ }
6
+
7
+ class WpdiscuzCache implements WpDiscuzConstants {
8
+
9
+ public $gravatars;
10
+ public $wpUploadsDir;
11
+ public $doGravatarsCache;
12
+ private $avBaseDir;
13
+ private $currentTime;
14
+ private $timeout;
15
+ private $optionsSerialized;
16
+ private $helper;
17
+ private $dbManager;
18
+
19
+ public function __construct($optionsSerialized, $helper, $dbManager) {
20
+ $this->optionsSerialized = $optionsSerialized;
21
+ $this->helper = $helper;
22
+ $this->dbManager = $dbManager;
23
+ $this->gravatars = array();
24
+ $this->wpUploadsDir = wp_upload_dir();
25
+ $this->avBaseDir = $this->wpUploadsDir['basedir'] . self::GRAVATARS_CACHE_DIR;
26
+ $this->currentTime = current_time('timestamp');
27
+ $this->timeout = $this->optionsSerialized->gravatarCacheTimeout * DAY_IN_SECONDS;
28
+ $this->doGravatarsCache = $this->optionsSerialized->isGravatarCacheEnabled && $this->optionsSerialized->isFileFunctionsExists;
29
+ if ($this->doGravatarsCache) {
30
+ wp_mkdir_p($this->avBaseDir);
31
+ add_filter('pre_get_avatar', array(&$this, 'preGetGravatar'), 10, 3);
32
+ add_filter('get_avatar', array(&$this, 'getAvatar'), 10, 6);
33
+ if ($this->optionsSerialized->gravatarCacheMethod == 'runtime') {
34
+ add_filter('get_avatar_url', array(&$this, 'gravatarsRunTime'), 10, 3);
35
+ } else {
36
+ add_filter('get_avatar_url', array(&$this, 'gravatarsCronJob'), 10, 3);
37
+ }
38
+ }
39
+ add_action('admin_post_purgeExpiredGravatarsCaches', array(&$this, 'purgeExpiredGravatarsCaches'));
40
+ add_action('admin_post_purgeGravatarsCaches', array(&$this, 'purgeGravatarsCaches'));
41
+ }
42
+
43
+ public function preGetGravatar($avatar, $idOrEmail, $args) {
44
+ $avatar = $this->getAvatarHtml($avatar, $idOrEmail, $args);
45
+ return $avatar;
46
+ }
47
+
48
+ public function getAvatar($avatar, $idOrEmail, $size, $default, $alt, $args) {
49
+ if (strpos($avatar, self::GRAVATARS_CACHE_DIR) === false) {
50
+ $avatar = $this->getAvatarHtml($avatar, $idOrEmail, $args);
51
+ }
52
+ return $avatar;
53
+ }
54
+
55
+ private function getAvatarHtml($avatar, $idOrEmail, $args) {
56
+ if ($idOrEmail && $args &&
57
+ isset($args['wpdiscuz_gravatar_field']) &&
58
+ $args['wpdiscuz_gravatar_field'] != ''
59
+ ) {
60
+ $cacheFileUrl = is_ssl() ? str_replace('http://', 'https://', $this->wpUploadsDir['baseurl']) . self::GRAVATARS_CACHE_DIR : $this->wpUploadsDir['baseurl'] . self::GRAVATARS_CACHE_DIR;
61
+ $md5FileName = $this->getMD5FieldName($args['wpdiscuz_gravatar_field']);
62
+ if ($md5FileName) {
63
+ $fileNameHash = $md5FileName . '.gif';
64
+ $fileDirHash = $this->avBaseDir . $fileNameHash;
65
+ if (file_exists($fileDirHash)) {
66
+ $fileUrlHash = $cacheFileUrl . $fileNameHash;
67
+ $url = $fileUrlHash;
68
+ $url2x = $fileUrlHash;
69
+ $class = array('avatar', 'avatar-' . (int) $args['size'], 'photo');
70
+ if ($args['force_default']) {
71
+ $class[] = 'avatar-default';
72
+ }
73
+
74
+ if ($args['class']) {
75
+ if (is_array($args['class'])) {
76
+ $class = array_merge($class, $args['class']);
77
+ } else {
78
+ $class[] = $args['class'];
79
+ }
80
+ }
81
+
82
+ $avatar = sprintf(
83
+ "<img alt='%s' src='%s' srcset='%s' class='%s' height='%d' width='%d' %s/>", esc_attr($args['alt']), esc_url($url), esc_attr("$url2x 2x"), esc_attr(join(' ', $class)), (int) $args['height'], (int) $args['width'], $args['extra_attr']
84
+ );
85
+ }
86
+ }
87
+ }
88
+ return $avatar;
89
+ }
90
+
91
+ public function gravatarsRunTime($url, $idOrEmail, $args) {
92
+ if ($url && $idOrEmail && $args &&
93
+ isset($args['wpdiscuz_gravatar_field']) &&
94
+ isset($args['size']) &&
95
+ isset($args['wpdiscuz_gravatar_size']) &&
96
+ $args['wpdiscuz_gravatar_field'] != '' &&
97
+ $args['size'] == $args['wpdiscuz_gravatar_size'] &&
98
+ $fileData = @file_get_contents($url)
99
+ ) {
100
+ $md5FileName = $this->getMD5FieldName($args['wpdiscuz_gravatar_field']);
101
+ if ($md5FileName) {
102
+ $fileNameHash = $md5FileName . '.gif';
103
+ $cacheFile = $this->avBaseDir . $fileNameHash;
104
+ if (@file_put_contents($cacheFile, $fileData)) {
105
+ $cacheFileUrl = is_ssl() ? str_replace('http://', 'https://', $this->wpUploadsDir['baseurl']) . self::GRAVATARS_CACHE_DIR : $this->wpUploadsDir['baseurl'] . self::GRAVATARS_CACHE_DIR;
106
+ $fileUrlHash = $cacheFileUrl . $fileNameHash;
107
+ $url = $fileUrlHash;
108
+ $this->gravatars[$md5FileName] = array(
109
+ 'user_id' => intval($args['wpdiscuz_gravatar_user_id']),
110
+ 'user_email' => trim($args['wpdiscuz_gravatar_user_email']),
111
+ 'url' => trim($url),
112
+ 'hash' => trim($md5FileName),
113
+ 'cached' => 1
114
+ );
115
+ }
116
+ }
117
+ }
118
+ return $url;
119
+ }
120
+
121
+ public function gravatarsCronJob($url, $idOrEmail, $args) {
122
+ if ($url && $idOrEmail && $args &&
123
+ isset($args['wpdiscuz_gravatar_field']) &&
124
+ isset($args['size']) &&
125
+ isset($args['wpdiscuz_gravatar_size']) &&
126
+ $args['wpdiscuz_gravatar_field'] != '' &&
127
+ $args['size'] == $args['wpdiscuz_gravatar_size']
128
+ ) {
129
+ $md5FileName = $this->getMD5FieldName($args['wpdiscuz_gravatar_field']);
130
+ if ($md5FileName) {
131
+ $this->gravatars[$md5FileName] = array(
132
+ 'user_id' => intval($args['wpdiscuz_gravatar_user_id']),
133
+ 'user_email' => trim($args['wpdiscuz_gravatar_user_email']),
134
+ 'url' => trim($url),
135
+ 'hash' => trim($md5FileName),
136
+ 'cached' => 0
137
+ );
138
+ }
139
+ }
140
+ return $url;
141
+ }
142
+
143
+ public function cacheGravatars() {
144
+ $gravatars = $this->dbManager->getGravatars();
145
+ if ($gravatars) {
146
+ $cachedIds = array();
147
+ foreach ($gravatars as $gravatar) {
148
+ $id = $gravatar['id'];
149
+ $url = $gravatar['url'];
150
+ $hash = $gravatar['hash'];
151
+ if ($fileData = @file_get_contents($url)) {
152
+ $cacheFile = $this->avBaseDir . $hash . '.gif';
153
+ if (@file_put_contents($cacheFile, $fileData)) {
154
+ $cachedIds[] = $id;
155
+ }
156
+ }
157
+ }
158
+ $this->dbManager->updateGravatarsStatus($cachedIds);
159
+ }
160
+ }
161
+
162
+ public function purgeExpiredGravatarsCaches() {
163
+ if (current_user_can('manage_options') && isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'purgeExpiredGravatarsCaches')) {
164
+ $timeFrame = $this->optionsSerialized->gravatarCacheTimeout * DAY_IN_SECONDS;
165
+ $expiredGravatars = $this->dbManager->getExpiredGravatars($timeFrame);
166
+ if ($expiredGravatars) {
167
+ $files = function_exists('scandir') ? scandir($this->avBaseDir) : false;
168
+ if ($files) {
169
+ foreach ($files as $file) {
170
+ if (in_array($file, $expiredGravatars)) {
171
+ @unlink($this->avBaseDir . $file);
172
+ }
173
+ }
174
+ }
175
+ $this->dbManager->deleteExpiredGravatars($timeFrame);
176
+ }
177
+ }
178
+ wp_redirect(admin_url('edit-comments.php?page=' . self::PAGE_SETTINGS));
179
+ }
180
+
181
+ public function purgeGravatarsCaches() {
182
+ if (current_user_can('manage_options') && isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'purgeGravatarsCaches')) {
183
+ $this->deleteGravatars();
184
+ }
185
+ wp_redirect(admin_url('edit-comments.php?page=' . self::PAGE_SETTINGS));
186
+ }
187
+
188
+ public function deleteGravatars() {
189
+ $files = function_exists('scandir') ? scandir($this->avBaseDir) : false;
190
+ if ($files && is_array($files)) {
191
+ foreach ($files as $file) {
192
+ if ($file != '.' && $file != '..' && $file != '.htaccess') {
193
+ @unlink($this->avBaseDir . $file);
194
+ }
195
+ }
196
+ }
197
+ $this->dbManager->deleteGravatars();
198
+ }
199
+
200
+ private function getMD5FieldName($md5Field) {
201
+ $fieldName = '';
202
+ if (is_object($md5Field)) {
203
+ $fieldName = isset($md5Field->comment_author_email) ? md5($md5Field->comment_author_email) : '';
204
+ } else {
205
+ $fieldName = md5($md5Field);
206
+ }
207
+ return $fieldName;
208
+ }
209
+
210
+ }
utils/class.WpdiscuzEmailHelper.php CHANGED
@@ -58,6 +58,7 @@ class WpdiscuzEmailHelper {
58
  $unsubscribe_url = $this->dbManager->unsubscribeLink($postId, $email);
59
  $siteUrl = get_site_url();
60
  $blogTitle = get_option('blogname');
 
61
  if (strpos($message, '[SITE_URL]') !== false) {
62
  $message = str_replace('[SITE_URL]', $siteUrl, $message);
63
  }
@@ -68,10 +69,15 @@ class WpdiscuzEmailHelper {
68
  if (strpos($message, '[BLOG_TITLE]') !== false) {
69
  $message = str_replace('[BLOG_TITLE]', $blogTitle, $message);
70
  }
71
- if (strpos($message, '[POST_TITLE]') !== false) {
72
- $postTitle = get_the_title($postId);
73
  $message = str_replace('[POST_TITLE]', $postTitle, $message);
74
  }
 
 
 
 
 
 
75
  $message .= "<br/><br/><a href='$confirm_url'>" . $this->optionsSerialized->phrases['wc_confirm_email'] . "</a>";
76
  $message .= "<br/><br/><a href='$unsubscribe_url'>" . $this->optionsSerialized->phrases['wc_ignore_subscription'] . "</a>";
77
  $headers = array();
@@ -112,6 +118,7 @@ class WpdiscuzEmailHelper {
112
 
113
  $siteUrl = get_site_url();
114
  $blogTitle = get_option('blogname');
 
115
  if (strpos($message, '[SITE_URL]') !== false) {
116
  $message = str_replace('[SITE_URL]', $siteUrl, $message);
117
  }
@@ -122,8 +129,7 @@ class WpdiscuzEmailHelper {
122
  if (strpos($message, '[BLOG_TITLE]') !== false) {
123
  $message = str_replace('[BLOG_TITLE]', $blogTitle, $message);
124
  }
125
- if (strpos($message, '[POST_TITLE]') !== false) {
126
- $postTitle = get_the_title($comment->comment_post_ID);
127
  $message = str_replace('[POST_TITLE]', $postTitle, $message);
128
  }
129
  if (strpos($message, '[COMMENT_URL]') !== false) {
@@ -136,7 +142,12 @@ class WpdiscuzEmailHelper {
136
  if (strpos($message, '[COMMENT_CONTENT]') !== false) {
137
  $message = str_replace('[COMMENT_CONTENT]', $comment->comment_content, $message);
138
  }
139
-
 
 
 
 
 
140
  $message .= "<br/><br/><a href='$unsubscribeUrl'>" . $this->optionsSerialized->phrases['wc_unsubscribe'] . "</a>";
141
  $headers = array();
142
  $mailContentType = apply_filters('wp_mail_content_type', 'text/html');
@@ -283,6 +294,7 @@ class WpdiscuzEmailHelper {
283
  $message = $this->optionsSerialized->phrases['wc_comment_approved_email_message'];
284
  $siteUrl = get_site_url();
285
  $blogTitle = get_option('blogname');
 
286
  if (strpos($message, '[SITE_URL]') !== false) {
287
  $message = str_replace('[SITE_URL]', $siteUrl, $message);
288
  }
@@ -293,8 +305,7 @@ class WpdiscuzEmailHelper {
293
  if (strpos($message, '[BLOG_TITLE]') !== false) {
294
  $message = str_replace('[BLOG_TITLE]', $blogTitle, $message);
295
  }
296
- if (strpos($message, '[POST_TITLE]') !== false) {
297
- $postTitle = get_the_title($comment->comment_post_ID);
298
  $message = str_replace('[POST_TITLE]', $postTitle, $message);
299
  }
300
  if (strpos($message, '[COMMENT_URL]') !== false) {
@@ -307,7 +318,12 @@ class WpdiscuzEmailHelper {
307
  if (strpos($message, '[COMMENT_CONTENT]') !== false) {
308
  $message = str_replace('[COMMENT_CONTENT]', $comment->comment_content, $message);
309
  }
310
-
 
 
 
 
 
311
  $headers = array();
312
  $mailContentType = apply_filters('wp_mail_content_type', 'text/html');
313
  $fromName = apply_filters('wp_mail_from_name', $blogTitle);
58
  $unsubscribe_url = $this->dbManager->unsubscribeLink($postId, $email);
59
  $siteUrl = get_site_url();
60
  $blogTitle = get_option('blogname');
61
+ $postTitle = get_the_title($postId);
62
  if (strpos($message, '[SITE_URL]') !== false) {
63
  $message = str_replace('[SITE_URL]', $siteUrl, $message);
64
  }
69
  if (strpos($message, '[BLOG_TITLE]') !== false) {
70
  $message = str_replace('[BLOG_TITLE]', $blogTitle, $message);
71
  }
72
+ if (strpos($message, '[POST_TITLE]') !== false) {
 
73
  $message = str_replace('[POST_TITLE]', $postTitle, $message);
74
  }
75
+ if (strpos($subject, '[BLOG_TITLE]') !== false) {
76
+ $subject = str_replace('[BLOG_TITLE]', $blogTitle, $subject);
77
+ }
78
+ if (strpos($subject, '[POST_TITLE]') !== false) {
79
+ $subject = str_replace('[POST_TITLE]', $postTitle, $subject);
80
+ }
81
  $message .= "<br/><br/><a href='$confirm_url'>" . $this->optionsSerialized->phrases['wc_confirm_email'] . "</a>";
82
  $message .= "<br/><br/><a href='$unsubscribe_url'>" . $this->optionsSerialized->phrases['wc_ignore_subscription'] . "</a>";
83
  $headers = array();
118
 
119
  $siteUrl = get_site_url();
120
  $blogTitle = get_option('blogname');
121
+ $postTitle = get_the_title($comment->comment_post_ID);
122
  if (strpos($message, '[SITE_URL]') !== false) {
123
  $message = str_replace('[SITE_URL]', $siteUrl, $message);
124
  }
129
  if (strpos($message, '[BLOG_TITLE]') !== false) {
130
  $message = str_replace('[BLOG_TITLE]', $blogTitle, $message);
131
  }
132
+ if (strpos($message, '[POST_TITLE]') !== false) {
 
133
  $message = str_replace('[POST_TITLE]', $postTitle, $message);
134
  }
135
  if (strpos($message, '[COMMENT_URL]') !== false) {
142
  if (strpos($message, '[COMMENT_CONTENT]') !== false) {
143
  $message = str_replace('[COMMENT_CONTENT]', $comment->comment_content, $message);
144
  }
145
+ if (strpos($subject, '[BLOG_TITLE]') !== false) {
146
+ $subject = str_replace('[BLOG_TITLE]', $blogTitle, $subject);
147
+ }
148
+ if (strpos($subject, '[POST_TITLE]') !== false) {
149
+ $subject = str_replace('[POST_TITLE]', $postTitle, $subject);
150
+ }
151
  $message .= "<br/><br/><a href='$unsubscribeUrl'>" . $this->optionsSerialized->phrases['wc_unsubscribe'] . "</a>";
152
  $headers = array();
153
  $mailContentType = apply_filters('wp_mail_content_type', 'text/html');
294
  $message = $this->optionsSerialized->phrases['wc_comment_approved_email_message'];
295
  $siteUrl = get_site_url();
296
  $blogTitle = get_option('blogname');
297
+ $postTitle = get_the_title($comment->comment_post_ID);
298
  if (strpos($message, '[SITE_URL]') !== false) {
299
  $message = str_replace('[SITE_URL]', $siteUrl, $message);
300
  }
305
  if (strpos($message, '[BLOG_TITLE]') !== false) {
306
  $message = str_replace('[BLOG_TITLE]', $blogTitle, $message);
307
  }
308
+ if (strpos($message, '[POST_TITLE]') !== false) {
 
309
  $message = str_replace('[POST_TITLE]', $postTitle, $message);
310
  }
311
  if (strpos($message, '[COMMENT_URL]') !== false) {
318
  if (strpos($message, '[COMMENT_CONTENT]') !== false) {
319
  $message = str_replace('[COMMENT_CONTENT]', $comment->comment_content, $message);
320
  }
321
+ if (strpos($subject, '[BLOG_TITLE]') !== false) {
322
+ $subject = str_replace('[BLOG_TITLE]', $blogTitle, $subject);
323
+ }
324
+ if (strpos($subject, '[POST_TITLE]') !== false) {
325
+ $subject = str_replace('[POST_TITLE]', $postTitle, $subject);
326
+ }
327
  $headers = array();
328
  $mailContentType = apply_filters('wp_mail_content_type', 'text/html');
329
  $fromName = apply_filters('wp_mail_from_name', $blogTitle);
utils/class.WpdiscuzHelperAjax.php CHANGED
@@ -14,7 +14,8 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
14
  $this->dbManager = $dbManager;
15
  add_action('wp_ajax_wpdiscuzStickComment', array(&$this, 'stickComment'));
16
  add_action('wp_ajax_wpdiscuzCloseThread', array(&$this, 'closeThread'));
17
- add_action('wp_ajax_wpdDeactivate', array(&$this, 'wpdDeactivate'));
 
18
  add_filter('wp_update_comment_data', array(&$this, 'commentDataArr'), 10, 3);
19
  }
20
 
@@ -80,7 +81,7 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
80
  wp_die(json_encode($response));
81
  }
82
 
83
- public function wpdDeactivate() {
84
  $response = array('code' => 0);
85
  $json = filter_input(INPUT_POST, 'deactivateData');
86
  if ($json) {
@@ -104,6 +105,8 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
104
  if (isset($data['deactivation_reason_desc']) && ($reasonDesc = trim($data['deactivation_reason_desc']))) {
105
  $message .= "<strong>Deactivation reason description:</strong> " . $reasonDesc . "\r\n" . "<br/>";
106
  }
 
 
107
  $sent = wp_mail($to, $subject, $message, $headers);
108
  $response['code'] = 'send_and_deactivate';
109
  }
@@ -111,6 +114,34 @@ class WpdiscuzHelperAjax implements WpDiscuzConstants {
111
  wp_die(json_encode($response));
112
  }
113
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  public function commentDataArr($data, $comment, $commentarr) {
115
  if (isset($data['wpdiscuz_comment_update']) && $data['wpdiscuz_comment_update']) {
116
  $data['comment_date'] = $comment->comment_date;
14
  $this->dbManager = $dbManager;
15
  add_action('wp_ajax_wpdiscuzStickComment', array(&$this, 'stickComment'));
16
  add_action('wp_ajax_wpdiscuzCloseThread', array(&$this, 'closeThread'));
17
+ add_action('wp_ajax_wpdDeactivate', array(&$this, 'deactivate'));
18
+ add_action('wp_ajax_wpdImportSTCR', array(&$this, 'importSTCR'));
19
  add_filter('wp_update_comment_data', array(&$this, 'commentDataArr'), 10, 3);
20
  }
21
 
81
  wp_die(json_encode($response));
82
  }
83
 
84
+ public function deactivate() {
85
  $response = array('code' => 0);
86
  $json = filter_input(INPUT_POST, 'deactivateData');
87
  if ($json) {
105
  if (isset($data['deactivation_reason_desc']) && ($reasonDesc = trim($data['deactivation_reason_desc']))) {
106
  $message .= "<strong>Deactivation reason description:</strong> " . $reasonDesc . "\r\n" . "<br/>";
107
  }
108
+ $pluginData = get_plugin_data(WPDISCUZ_DIR_PATH . "/class.WpdiscuzCore.php");
109
+ $message .= '<strong>wpDiscuz Version:</strong>' . $pluginData['Version'] . "\r\n" . "<br/>";
110
  $sent = wp_mail($to, $subject, $message, $headers);
111
  $response['code'] = 'send_and_deactivate';
112
  }
114
  wp_die(json_encode($response));
115
  }
116
 
117
+ public function importSTCR() {
118
+ $response = array('progress' => 0);
119
+ $stcrData = isset($_POST['stcrData']) ? $_POST['stcrData'] : '';
120
+ if ($stcrData) {
121
+ parse_str($stcrData, $data);
122
+ $limit = 50;
123
+ $step = isset($data['stcr-step']) ? intval($data['stcr-step']) : 0;
124
+ $stcrSubscriptionsCount = isset($data['stcr-subscriptions-count']) ? intval($data['stcr-subscriptions-count']) : 0;
125
+ $nonce = isset($data['_wpnonce']) ? trim($data['_wpnonce']) : '';
126
+ if (wp_verify_nonce($nonce, 'wc_tools_form') && $stcrSubscriptionsCount) {
127
+ $offset = $limit * $step;
128
+ if ($limit && $offset >= 0) {
129
+ $subscriptions = $this->dbManager->getStcrSubscriptions($limit, $offset);
130
+ if ($subscriptions) {
131
+ $this->dbManager->addStcrSubscriptions($subscriptions);
132
+ ++$step;
133
+ $response['step'] = $step;
134
+ $progress = $offset ? $offset * 100 / $stcrSubscriptionsCount : $limit * 100 / $stcrSubscriptionsCount;
135
+ $response['progress'] = intval($progress);
136
+ } else {
137
+ $response['progress'] = 100;
138
+ }
139
+ }
140
+ }
141
+ }
142
+ wp_die(json_encode($response));
143
+ }
144
+
145
  public function commentDataArr($data, $comment, $commentarr) {
146
  if (isset($data['wpdiscuz_comment_update']) && $data['wpdiscuz_comment_update']) {
147
  $data['comment_date'] = $comment->comment_date;