File: /var/www/html/somosedsa.sumar.com.py/wp-content/plugins/wpdiscuz-widgets/tabs/recent-comments.php
<?php if ( ! defined( "ABSPATH" ) ) {
exit();
} ?>
<div id="wpdiscuz-recent-comments-box" class="wpd-wid-recent-comments">
<?php
if ( $this->options["wpdiscuz_widget_theme_title_struct"] === 1 ) {
echo $before_title . $title_recent_comments . $after_title;
} else {
echo "<h2 class='wpd_widgets_title'> $title_recent_comments </h2>";
}
$wpdiscuz_widget_author_link = $this->options["wpdiscuz_widget_author_link"];
$args = [
"number" => $count_recent_comments,
"status" => "approve",
"orderby" => "comment_date",
// "caller" => "wpdiscuz_widgets_rc",
];
$args = apply_filters( "wpdiscuz_widget_recent_comments_args", $args );
$wpd_comments = get_comments( $args );
?>
<div class="wpd_widgets_items_wrapper">
<?php
foreach ( $wpd_comments as $wpd_comment ) {
$comm_date = date( $this->widget_date_format, strtotime( $wpd_comment->comment_date ) );
$currentUser = get_user_by( 'ID', $wpd_comment->user_id );
$user_link = get_author_posts_url( $wpd_comment->user_id );
$user_posts_count = $wpd_comment->user_id ? count_user_posts( $wpd_comment->user_id ) : - 1;
$user_avatar = get_avatar( $wpd_comment->comment_author_email, "", "", "", [ "class" => "recent-comment-author-avatar" ] );
if ( $this->options["wpdiscuz_widget_post_title_cutting"] ) {
$comment_post_title = get_the_title( $wpd_comment->comment_post_ID );
$comment_post_title = wp_trim_words( $comment_post_title, $this->options["wpdiscuz_widgets_post_title_word_count"] );
} else {
$comment_post_title = get_the_title( $wpd_comment->comment_post_ID );
}
$replaced_comment = wpautop( get_comment_excerpt( $wpd_comment ) );
$replaced_comment = preg_replace( "~\[spoiler.*?\[\/spoiler\]~", "", $replaced_comment );
$rc_comment_link = get_the_permalink( $wpd_comment->comment_post_ID );
if ( empty( $currentUser->ID ) ) {
$user_link = $user_posts_count > 0 ? $user_link : '';
} else {
$user_link = $wpdiscuz->helper->getProfileUrl( $user_link, $currentUser );
}
?>
<div>
<div class="wpdiscuz-widget-popular-comment-author" style="">
<?php if ( get_option( 'show_avatars' ) ): ?>
<div class='popular-comment-author-avatar-box'>
<div class='commenter-avatar-box <?php echo ( $this->options["wpdiscuz_widget_icon_circle"] === 1 ) ? 'icon-circle' : ''; ?>'>
<?php
if ( $wpdiscuz_widget_author_link && $user_link ) {
printf( __( "<a href='%s'>%s</a>", "wpdiscuz-widgets" ), $user_link, $user_avatar );
} else {
echo $user_avatar;
}
?>
</div>
</div>
<?php endif; ?>
<div class="popular-comment-author-body">
<a href="<?php echo $rc_comment_link . "#comment-" . $wpd_comment->comment_ID; ?>"><?php echo $comment_post_title; ?></a>
<div class="wpdwd-recent-comment-date">
<?php
echo $wpdiscuz->options->general["simpleCommentDate"] ? $comm_date : $wpdiscuz->helper->dateDiff( $wpd_comment->comment_date_gmt );
if ( $wpdiscuz_widget_author_link && $user_link ) {
printf( __( " by <a href='%s'>%s</a>", "wpdiscuz-widgets" ), $user_link, $wpd_comment->comment_author );
} else {
printf( __( " by %s", "wpdiscuz-widgets" ), $wpd_comment->comment_author );
}
?>
</div>
<div class="wpdwd-recent-comment-content"><a
href="<?php echo $rc_comment_link . "#comment-" . $wpd_comment->comment_ID; ?>"><?php echo $replaced_comment; ?></a>
</div>
</div>
</div>
<hr class="delim">
</div>
<?php
}
?>
</div>
</div>