mirror of
https://github.com/jkjoy/typecho-theme-farallon.git
synced 2026-06-28 00:54:32 +00:00
0.6.3
使用API获取IP归属地
This commit is contained in:
+14
-17
@@ -50,8 +50,7 @@
|
||||
<?php if ($comments->have()): ?>
|
||||
<?php $comments->listComments(); ?>
|
||||
|
||||
<?php
|
||||
$comments->pageNav(
|
||||
<?php $comments->pageNav(
|
||||
' ',
|
||||
' ',
|
||||
1,
|
||||
@@ -93,31 +92,30 @@ function threadedComments($comments, $options) {
|
||||
}
|
||||
echo $commentClass;
|
||||
?>">
|
||||
<?php $commentApprove = commentApprove($comments, $comments->mail); ?>
|
||||
<div class="comment-body" id="<?php $comments->theId(); ?>">
|
||||
<div class="comment-meta">
|
||||
<div class="comment--avatar">
|
||||
<?php if ($comments->url): ?>
|
||||
<a href="<?php echo $comments->url ?>" target="_blank" rel="external nofollow"><?php echo $comments->gravatar('40', ''); ?> </a>
|
||||
<a href="<?php echo $comments->url ?>" target="_blank" rel="external nofollow" title=" <?php echo $commentApprove['userDesc']; ?> ">
|
||||
<?php echo $comments->gravatar('40', ''); ?>
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<?php echo $comments->gravatar('40', ''); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="comment--meta">
|
||||
<div class="comment--author"><?php echo $comments->author; ?>
|
||||
<div class="comment--author">
|
||||
<span style="color: <?php echo $commentApprove['bgColor']; ?>;">
|
||||
<p class="tooltip" data-tooltip=" <?php echo $commentApprove['userLevel']; ?> ">
|
||||
<?php echo $comments->author; ?>
|
||||
</p>
|
||||
</span>
|
||||
<span class="dot"></span>
|
||||
<?php $commentApprove = commentApprove($comments, $comments->mail); ?>
|
||||
<span style="color: <?php echo $commentApprove['bgColor']; ?>;">
|
||||
<?php echo $commentApprove['userLevel']; ?>
|
||||
</span>
|
||||
<span class="dot"></span>
|
||||
<div class="comment--time"><?php $comments->date('Y-m-d H:i'); ?></div>
|
||||
<span class="dot"></span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 20.8995L16.9497 15.9497C19.6834 13.2161 19.6834 8.78392 16.9497 6.05025C14.2161 3.31658 9.78392 3.31658 7.05025 6.05025C4.31658 8.78392 4.31658 13.2161 7.05025 15.9497L12 20.8995ZM12 23.7279L5.63604 17.364C2.12132 13.8492 2.12132 8.15076 5.63604 4.63604C9.15076 1.12132 14.8492 1.12132 18.364 4.63604C21.8787 8.15076 21.8787 13.8492 18.364 17.364L12 23.7279ZM12 13C13.1046 13 14 12.1046 14 11C14 9.89543 13.1046 9 12 9C10.8954 9 10 9.89543 10 11C10 12.1046 10.8954 13 12 13ZM12 15C9.79086 15 8 13.2091 8 11C8 8.79086 9.79086 7 12 7C14.2091 7 16 8.79086 16 11C16 13.2091 14.2091 15 12 15Z"></path></svg>
|
||||
<?php
|
||||
$ip = $comments->ip; // Ensure this is the correct property for IP
|
||||
$location = get_ip_location($ip);
|
||||
echo htmlspecialchars($location['country']);
|
||||
?>
|
||||
<?php $ip = $comments->ip; $location = get_ip_location($ip); display_location($location); ?>
|
||||
<span class="comment-reply-link u-cursorPointer">
|
||||
<?php $comments->reply('<svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true" class="" ><g><path d="M12 3.786c-4.556 0-8.25 3.694-8.25 8.25s3.694 8.25 8.25 8.25c1.595 0 3.081-.451 4.341-1.233l1.054 1.7c-1.568.972-3.418 1.534-5.395 1.534-5.661 0-10.25-4.589-10.25-10.25S6.339 1.786 12 1.786s10.25 4.589 10.25 10.25c0 .901-.21 1.77-.452 2.477-.592 1.731-2.343 2.477-3.917 2.334-1.242-.113-2.307-.74-3.013-1.647-.961 1.253-2.45 2.011-4.092 1.78-2.581-.363-4.127-2.971-3.76-5.578.366-2.606 2.571-4.688 5.152-4.325 1.019.143 1.877.637 2.519 1.342l1.803.258-.507 3.549c-.187 1.31.761 2.509 2.079 2.629.915.083 1.627-.356 1.843-.99.2-.585.345-1.224.345-1.83 0-4.556-3.694-8.25-8.25-8.25zm-.111 5.274c-1.247-.175-2.645.854-2.893 2.623-.249 1.769.811 3.143 2.058 3.319 1.247.175 2.645-.854 2.893-2.623.249-1.769-.811-3.144-2.058-3.319z"></path></g></svg>'); ?>
|
||||
</span>
|
||||
@@ -125,8 +123,7 @@ function threadedComments($comments, $options) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="comment-content">
|
||||
<?php if ($comments->parent) {echo getPermalinkFromCoid($comments->parent);}?>
|
||||
<?php $comments->content(); ?>
|
||||
<?php if ($comments->parent) {echo getPermalinkFromCoid($comments->parent);} $comments->content();?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($comments->children) { ?>
|
||||
@@ -135,4 +132,4 @@ function threadedComments($comments, $options) {
|
||||
</ol>
|
||||
<?php } ?>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
Reference in New Issue
Block a user