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.sceybwg.com/wp-content/themes/Modular/template/module-page/theme-history-2.php
<?php
/**
 * Template: 时间轴-2
 * @Author: 大胡子
 * @Email:  dahuzi@xintheme.com
 * @Link:   www.xintheme.com
 * @Date:   2023-08-01 07:27:28
 * @Last Modified by:   dahuzi
 * @Last Modified time: 2024-11-06 17:37:27
 */

//模块id
$data_settings    = wp_json_encode([
    'id' => $module['id'],
]);
// 将 JSON 数据转义为 HTML 属性
$data_settings = esc_attr($data_settings);

//模块内容
if(is_array($module_content)){

//配色
$history_text_color = $module_setting['history_text_color'] ?? '';
$history_highlight_color = $module_setting['history_highlight_color'] ?? '';
$style_color = '';

if (!empty($history_text_color)) {
    $style_color .= "--theme-history2-color: {$history_text_color};";
}

if (!empty($history_highlight_color)) {
    $style_color .= "--theme-history2-hover-color: {$history_highlight_color};";
}
?>

<div class="section theme-history2 theme-history-<?php echo $module['id'];?>"<?php if( !empty($module_setting['module_bg']) ){ echo ' style="background:url('.$module_setting['module_bg'].') no-repeat center 0 / cover;"';}?> data-settings=<?php echo $data_settings;?>>

    <div class="container"<?php echo $style_color ? ' style="' . $style_color . '"' : ''; ?>>
        <?php
        if( !empty($module_setting['title_display']) ){?>
        <div class="section-title <?php echo $wow_style;?>">
            <?php
            if( !empty($module_title) ){
            echo '<strong>'.$module_title.'</strong>';
            }
            if( !empty($module_desc) ){
            echo '<p>'.$module_desc.'</p>';
            }
            ?>
        </div>
        <?php }?>

        <?php
        if( isset($module_setting['history_position']) && $module_setting['history_position'] === 'position_top' ){?>
        <div class="swiper history-swiper-date history-position-top<?php if( isset($module_setting['history_prev_next']) && $module_setting['history_prev_next'] === 'style_2' ){ echo ' history-prev_next-none'; }?>">
            <div class="swiper-wrapper">
                <?php
                foreach ($module_content as $value) {
                    if( !empty($value['item_date']) ){ ?>
                    <div class="swiper-slide">
                        <div class="history-date">
                            <p><?php echo $value['item_date'];?></p>
                        </div>
                    </div>
                    <?php
                    }
                }?>
            </div>
            <?php
            if( isset($module_setting['history_prev_next']) && $module_setting['history_prev_next'] === 'style_1' ){?>
            <div class="history-nav">
                <div class="swiper-button-prev history-prev"></div>
                <div class="swiper-button-next history-next"></div>
            </div>
            <?php }?>
        </div>
        <?php }?>

        <div class="history-module">
            <div class="swiper history-swiper">
                <div class="swiper-wrapper">
                <?php foreach ($module_content as $value) {?>
                    <div class="swiper-slide">
                        <div class="history-details">
                            <?php if( !empty($value['item_img']) ){?>
                            <div class="history-img">
                                <img loading="lazy" src="<?php echo $value['item_img'];?>" alt="" />
                            </div>
                            <?php }?>
                            <?php if( !empty($value['item_desc']) || !empty($value['item_title']) ){?>
                            <div class="history-text">
                                <?php
                                if( !empty($value['item_title']) ){
                                    echo '<h3>'.$value['item_title'].'</h3>';
                                }
                                if( !empty($value['item_desc']) ){
                                    echo do_shortcode($value['item_desc']);
                                }?>
                            </div>
                            <?php }?>
                        </div>
                    </div>
                <?php }?>
                </div>
            </div>
        </div>

        <?php
        if( isset($module_setting['history_position']) && $module_setting['history_position'] === 'position_bottom' ){?>
        <div class="swiper history-swiper-date history-position-bottom<?php if( isset($module_setting['history_prev_next']) && $module_setting['history_prev_next'] === 'style_2' ){ echo ' history-prev_next-none'; }?>">
            <div class="swiper-wrapper">
                <?php
                foreach ($module_content as $value) {
                    if( !empty($value['item_date']) ){ ?>
                    <div class="swiper-slide">
                        <div class="history-date">
                            <p><?php echo $value['item_date'];?></p>
                        </div>
                    </div>
                    <?php
                    }
                }?>
            </div>
            <?php
            if( isset($module_setting['history_prev_next']) && $module_setting['history_prev_next'] === 'style_1' ){?>
            <div class="history-nav">
                <div class="swiper-button-prev history-prev"></div>
                <div class="swiper-button-next history-next"></div>
            </div>
            <?php }?>
        </div>
        <?php }?>
    </div>
</div>
<?php }

//echo wpjam_print_r( $module_setting );
//echo wpjam_print_r( $module_content );
//echo wpjam_print_r( $module_style );