HEX
Server: nginx/1.16.1
System: Linux VM-0-14-centos 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64
User: www (1000)
PHP: 8.3.31
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.sceysls.com/wp-content/themes/Zing-Pro/public/comment.php
<?php
//评论列表
function wpjam_theme_list_comments($comment, $args, $depth) {
	$GLOBALS['comment'] = $comment;
	global $commentcount,$wpdb, $post;
	if(!$commentcount) { 
		$comments = get_comments(['post_id'=>$post->ID]);
		$cnt = count($comments);
		$page = get_query_var('cpage');
		$cpp=get_option('comments_per_page');
		if (ceil($cnt / $cpp) == 1 || ($page > 1 && $page	== ceil($cnt / $cpp))) {
			$commentcount = $cnt + 1;
		} else {
			$commentcount = $cpp * $page + 1;
		}
	}
?>
<li id="comment-<?php comment_ID() ?>" <?php comment_class(); ?>>
	<div id="div-comment-<?php comment_ID() ?>" class="comment-wrapper u-clearfix">
		<div class="comment-author-avatar vcard">
			<?php echo get_avatar($comment,60); ?>
		</div>
		<div class="comment-content">
			<div class="comment-author-name vcard">
				<cite class="fn"><?php /*wpjam_comment_level($comment);*/ comment_author_link();?></cite>
			</div>
			<div class="comment-metadata">
				<time><?php comment_date() ?> <?php comment_time() ?></time>
				<span class="reply-link">
					<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => "回复"))) ?>
				</span>
			</div>
			<div class="comment-body" itemprop="comment">
				<?php comment_text() ?>
				<?php if ( $comment->comment_approved == '0' ) : ?>
					<font style="color:#C00; font-style:inherit">您的评论正在等待审核中...</font>
				<?php endif; ?>
			</div>
		</div>
	</div>
</li>
<?php }

//评论等级
function wpjam_author_class($comment_author_email){
	global $wpdb; $author_count = count($wpdb->get_results( "SELECT comment_ID as author_count FROM $wpdb->comments WHERE comment_author_email = '$comment_author_email' ")); 
	$adminEmail = get_option('admin_email');if($comment_author_email ==$adminEmail) return;
	if($author_count>=1 && $author_count<10 && $comment_author_email!=$adminEmail)
		echo '<span class="level level-0">初来乍到</span>';
	else if($author_count>=10 && $author_count< 20)
		echo '<span class="level level-1">江湖少侠</span>';
	else if($author_count>=20 && $author_count< 40)
		echo '<span class="level level-2">崭露头角</span>';
	else if($author_count>=40 && $author_count< 60)
		echo '<span class="level level-3">自成一派</span>';
	else if($author_count>=60 && $author_count< 80)
		echo '<span class="level level-4">横扫千军</span>';
	else if($author_count>=80&& $author_count<100)
		echo '<span class="level level-5">登峰造极</span>';
	else if($author_count>=100&& $author_count< 120)
		echo '<span class="level level-6">一统江湖</span>';
}

function wpjam_comment_level($comment){
	$html = "";
	if(($vip = wpjam_author_class($comment->comment_author_email))){
		$html .= '' . $vip . '>';
		for($i = 0; $i < $vip; $i++){
			$html .= '';
		}
		$html .= '';
	};
	echo $html;
}