HEX
Server: nginx/1.28.1
System: Linux VM-0-12-opencloudos 6.6.117-45.oc9.x86_64 #1 SMP Thu Dec 4 10:26:39 CST 2025 x86_64
User: www (1000)
PHP: 7.4.33
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.waciwang.com/wp-content/themes/miragev-main/templates/media/media.php
<?php
$vt_config = vt_get_config();

$cur_post_id = get_the_ID();

$author_id = get_the_author_id();
$avatar = vt_get_custom_avatar_url($author_id);

$user_center_url = home_url() . '/users/' .$post->post_author;
// $default_image = $vt_config['default_image'] ? $vt_config['default_image'] : 
//                     get_template_directory_uri() . '/assets/images/default.jpg';

// 喜欢数量
$like_counter = 0;
$sql = "SELECT count(*) AS num FROM {$wpdb->prefix}vt_star WHERE object_id=%s AND type=%s";
$res = $wpdb->get_row($wpdb->prepare($sql, [$cur_post_id, 'like']), ARRAY_A );
$like_counter = $res['num'];

?>

<div class="media-item">
    <div class="media-thumbnail">
        <a href="<?php the_permalink() ?>" target="_blank">
            <img src="<?= vt_get_thumbnail_url($cur_post_id, 'medium') ?>" alt="<?php the_title(); ?>">
        </a>
    </div>
    
    <div class="media-main">
        <div class="media-title">
            <?php if(is_sticky()): ?>
                <div class="sticky">置顶</div>
            <?php endif ?>
            <a href="<?php the_permalink() ?>" target="_blank"><?php the_title(); ?></a>
        </div>
        <div class="media-description">
            <?php echo get_the_excerpt(); ?>
        </div>
        <div class="media-meta">
            <?php if($vt_config['user_center_is_on']):?>
                <a class="author" href="<?php echo $user_center_url ?>" target="_blank">
                    <img src="<?php echo $avatar ?>">
                    <span><?php echo get_the_author_meta('nickname', $post->post_author) ?></span>
                </a>
            <?php else: ?>
                <span class="author">
                    <img src="<?php echo $avatar ?>">
                    <span><?php echo get_the_author_meta('nickname', $post->post_author) ?></span>
                </span>
            <?php endif ?>

            <span class="date">
                <i class="fa-solid fa-clock"></i><?php the_time('Y-m-d'); ?>
            </span>
            <span class="hit-counter">
                <i class="fa-solid fa-eye"></i><?php echo getPostViews(get_the_ID()); ?>
            </span>
            <span class="star_counter">
                <i class="fa-solid fa-star"></i><?= $like_counter ?>
            </span>
            <?php if($vt_config['comments_is_on']):?>
                <span>
                    <i class="fa-solid fa-comment"></i><?php echo $post->comment_count; ?>
                </span>
            <?php endif ?>
        </div>
    </div>
</div>