helper->getCurrentUser(); do_action("wpdiscuz_before_load", $post, $currentUser); $load = apply_filters("wpdiscuz_load_template", true, $currentUser, $post); if (!post_password_required($post->ID) && $load) { $commentsCount = (int)get_comments_number(); $filtersVisibilityClass = $commentsCount === 0 ? 'wpdiscuz-hidden' : ''; $wpCommClasses = []; $wpCommClasses[] = $currentUser && $currentUser->ID ? "wpdiscuz_auth" : "wpdiscuz_unauth"; $wpCommClasses[] = $wpdiscuz->options->thread_styles["theme"]; if (!$wpdiscuz->options->thread_layouts["showAvatars"] || !$wpdiscuz->options->wp["showAvatars"]) { $wpCommClasses[] = "wpdiscuz_no_avatar"; } ?>
wpdiscuzForm->getForm($post->ID); $wpCommClasses[] = "wpd-layout-" . $form->getLayout(); $commentsOpen = comments_open($post); $wpCommClasses[] = $commentsOpen ? "wpd-comments-open" : "wpd-comments-closed"; $wpCommClasses = apply_filters("wpdiscuz_container_classes", $wpCommClasses); $wpCommClasses = implode(" ", $wpCommClasses); $currentUserId = 0; $currentUserEmail = isset($_COOKIE["comment_author_email_" . COOKIEHASH]) ? sanitize_email($_COOKIE["comment_author_email_" . COOKIEHASH]) : ""; if ($currentUser && $currentUser->ID) { $currentUserId = $currentUser->ID; $currentUserEmail = $currentUser->user_email; } $isShowSubscribeBar = $form->isShowSubscriptionBar() && WpdiscuzHelper::isUserCanFollowOrSubscribe($currentUserEmail); $isPostmaticActive = !class_exists("Prompt_Comment_Form_Handling") || (class_exists("Prompt_Comment_Form_Handling") && !$wpdiscuz->options->subscription["usePostmaticForCommentNotification"]); $wpdiscuz->helper->superSocializerFix(); if ($commentsOpen) { if ($formCustomCss = $form->getCustomCSS()) { echo ""; } } else { do_action("comment_form_closed"); do_action("wpdiscuz_comment_form_closed", $post, $currentUser, $commentsCount); } do_action("wpdiscuz_comment_form_before"); ?>
options->getPhrase("wc_subscribe_anchor")); ?>
subscriptionData = $wpdiscuz->dbManager->hasSubscription($post->ID, $currentUser->user_email); $subscriptionType = null; if ($wpdiscuz->subscriptionData) { $isConfirmed = $wpdiscuz->subscriptionData["confirm"]; $subscriptionType = $wpdiscuz->subscriptionData["type"]; if ($subscriptionType === WpdiscuzCore::SUBSCRIPTION_POST || $subscriptionType === WpdiscuzCore::SUBSCRIPTION_ALL_COMMENT) { $unsubscribeLinkParams = $wpdiscuz->dbManager->getUnsubscribeLinkParams($post->ID, $currentUser->user_email); } } ?>
" method="post" id="wpdiscuz-subscribe-form">
options->getPhrase("wc_notify_of")); ?>
;">
ID) { ?>
" name="wpdiscuz_subscription_button"/>
ID && $form->isShowSubscriptionBarAgreement()) { ?>
getCaptchaFied(); $c->subscribtionRecaptchaHtml($wpdiscuz->options); ?>
options->getPhrase("wc_unsubscribe") : $wpdiscuz->options->getPhrase("wc_ignore_subscription"); if ($subscriptionType === "all_comment") { $introText = $wpdiscuz->options->getPhrase("wc_subscribed_to") . " " . $wpdiscuz->options->getPhrase("wc_notify_on_all_new_reply"); } elseif ($subscriptionType === "post") { $introText = $wpdiscuz->options->getPhrase("wc_subscribed_to") . " " . $wpdiscuz->options->getPhrase("wc_notify_on_new_comment"); } echo "
" . esc_html($introText) . " | " . esc_html($subscribeMessage) . "
"; } ?>
wpdiscuzForm->renderFrontForm($commentsCount, $currentUser); $output = ob_get_clean(); echo apply_filters("wpdiscuz_form_render", $output, $commentsCount, $currentUser); if (empty($currentUser->ID) && !$form->isUserCanComment($currentUser, $post->ID)) { ?>
isUserCanSeeComments($currentUser, $post->ID)) { $wooExists = class_exists("WooCommerce") && get_post_type($post->ID) === "product"; ?>
" data-comments-count=""> " . esc_html($wpdiscuz->helper->getNumber($commentsCount)) . " " . esc_html(apply_filters("wpdiscuz_comment_count_phrase", (1 == $commentsCount ? $form->getHeaderTextSingle() : $form->getHeaderTextPlural()), $commentsCount)); } else { echo ""; } ?>
options->login["showActivityTab"] || $wpdiscuz->options->login["showSubscriptionsTab"] || $wpdiscuz->options->login["showFollowsTab"] || apply_filters("wpdiscuz_enable_content_modal", false)) && $currentUserEmail) { echo apply_filters("wpdiscuz_user_settings_button", "", $currentUser, $currentUserEmail); } ?>
options); if (!$wpdiscuz->options->wp["isPaginate"] && $wpdiscuz->options->inline["showInlineFilterButton"] && $wpdiscuz->dbManager->postHasFeedbackForms($post->ID)) { ?>
">
options->thread_display["showReactedFilterButton"]) { ?>
">
options->thread_display["showHottestFilterButton"]) { ?>
">
options->wp["commentOrder"]; if (!$wpdiscuz->options->wp["isPaginate"] && $wpdiscuz->options->thread_display["showSortingButtons"] && $wpdiscuz->options->thread_display["mostVotedByDefault"]) { $wpdiscuzCommentsOrderBy = "by_vote"; } else { $wpdiscuzCommentsOrderBy = $wpdiscuz->options->thread_display["orderCommentsBy"]; } $wpdiscuzCommentsOrderBy = apply_filters("wpdiscuz_comments_order_by", $wpdiscuzCommentsOrderBy); $wpdiscuzCommentsOrder = apply_filters("wpdiscuz_comments_order", $wpdiscuzCommentsOrder); if ($wpdiscuz->options->thread_display["showSortingButtons"] && !$wpdiscuz->options->wp["isPaginate"]) { $sortingButtons = [ [ "orderBy" => $wpdiscuz->options->thread_display["orderCommentsBy"], "order" => "desc", "class" => "wpdiscuz-date-sort-desc", "text" => $wpdiscuz->options->getPhrase("wc_newest"), "type" => "newest", ], [ "orderBy" => $wpdiscuz->options->thread_display["orderCommentsBy"], "order" => "asc", "class" => "wpdiscuz-date-sort-asc", "text" => $wpdiscuz->options->getPhrase("wc_oldest"), "type" => "oldest", ], ]; if ($wpdiscuz->options->thread_layouts["showVotingButtons"]) { $sortingButtons[] = [ "orderBy" => "by_vote", "order" => $wpdiscuz->options->wp["commentOrder"], "class" => "wpdiscuz-vote-sort-up", "text" => $wpdiscuz->options->getPhrase("wc_most_voted"), "type" => "by_vote", ]; } $sortingButtons = apply_filters("wpdiscuz_sorting_buttons_array", $sortingButtons); ?>
$value) { if ($wpdiscuzCommentsOrderBy === $value["orderBy"] && $wpdiscuzCommentsOrder === $value["order"]) { ?> wpdiscuz-sort-button-active" data-sorting="">
$value) { ?> " data-sorting="">
options->getPhrase("wc_inline_feedbacks")); ?>
options->getPhrase("wc_inline_comments_view_all")); ?>
options->wp["isPaginate"] || !$wpdiscuz->options->thread_display["firstLoadWithAjax"]) { $args = [ "first_load" => 1, "orderby" => $wpdiscuzCommentsOrderBy, "order" => $wpdiscuzCommentsOrder ]; $commentData = $wpdiscuz->getWPComments($args); // $commentData["comment_list"] can not be escaped because this is returned by WP's wp_list_comments function echo $commentData["comment_list"]; } else if ($wpdiscuz->options->thread_display["firstLoadWithAjax"] == 2 && $commentsCount) { ?>
options->wp["isPaginate"] && $wpdiscuz->options->thread_display["firstLoadWithAjax"] ? " style='display:none;'" : ""; ?>> options->wp["isPaginate"]) { paginate_comments_links(); } else if ($wpdiscuz->options->thread_display["firstLoadWithAjax"]) { $loadMoreButtonText = $wpdiscuz->options->thread_display["commentListLoadType"] == 1 ? $wpdiscuz->options->getPhrase("wc_load_rest_comments_submit_text") : $wpdiscuz->options->getPhrase("wc_load_more_submit_text"); ?>
options->thread_display["commentListLoadType"] == 1 ? $wpdiscuz->options->getPhrase("wc_load_rest_comments_submit_text") : $wpdiscuz->options->getPhrase("wc_load_more_submit_text"); ?>
">
options->general["showPluginPoweredByLink"]) { ?>
wpdiscuz" align="absmiddle" class="wpdimg"/>   wpDiscuz
">
">