子比主题 – 自助式资源失效提交页面

这款模版是在的网站看到 就扒下来分享给大家

这是一款子比主题自助式资源失效提交页面模版,这款模版很方便让用户提交资源失效的需求,很实用的一款功能,话不多说喜欢的自行部署吧!

图片[1] - 子比主题 - 自助式资源失效提交页面
图片[2] - 子比主题 - 自助式资源失效提交页面
图片[3] - 子比主题 - 自助式资源失效提交页面

代码部署

这里一共有两个代码,第一个是func文件,第二个是子比的pages目录,跟着我的教程走不会有问题!

定位:/wp-content/themes/zibll/pages/目录,然后创建page-report.php文件,然后将下面的代码丢里面

<?php
/*
Template Name: Zibll工具箱-资源失效提交页
*/

$current_user_id = get_current_user_id();
$is_logged_in    = is_user_logged_in();

// VIP 权限检查逻辑 (未登录或非VIP则拦截)
// 新代码:只检查是否登录
if (!$is_logged_in) {
    get_header();
    
    // 使用 Zibll 的标准容器
    echo '<main class="container" style="padding-top:40px; padding-bottom:60px;">';
    echo '<div class="content-wrap"><div class="content-layout">';
    
    // 卡片容器
    echo '<div class="zib-widget-box zib-widget-body radius8 main-shadow text-center" style="padding: 60px 20px; max-width: 700px; margin: 0 auto;">';
    
    // 404 图片
    $img_url = get_template_directory_uri() . '/img/404.svg'; 
    echo '<div style="margin-bottom:30px;"><img src="' . $img_url . '" style="height:200px; width:auto; display:inline-block;"></div>';
    
    // 标题与文案
    echo '<h2 class="title-h2" style="font-size:24px; margin-bottom:15px;">抱歉,无法访问此页面</h2>';
    echo '<p class="muted-color" style="font-size:15px; margin-bottom:40px;">此页面仅对 VIP 会员开放</p>';
    
    // 按钮组
    echo '<div class="action-buttons" style="display:flex; justify-content:center; gap:20px; flex-wrap:wrap;">';
    
    if (!$is_logged_in) {
        // 未登录状态
        echo '<a href="javascript:;" class="but c-blue signin-loader" style="padding:8px 35px; font-size:15px;"><i class="fa fa-user-circle-o"></i> 登录账号</a>';
        echo '<a href="javascript:;" class="but c-yellow signup-loader" style="padding:8px 35px; font-size:15px;"><i class="fa fa-user-plus"></i> 注册会员</a>';
    } else {
        // 已登录但不是VIP
        echo '<a href="javascript:;" class="but c-yellow pay-vip" style="padding:8px 35px; font-size:15px; box-shadow: 0 4px 15px rgba(255, 170, 0, 0.3);"><i class="fa fa-diamond"></i> 开通 VIP</a>';
        echo '<a href="'.home_url().'" class="but c-green" style="padding:8px 35px; font-size:15px;"><i class="fa fa-home"></i> 返回首页</a>';
    }
    
    echo '</div>'; // End buttons
    echo '</div>'; // End card
    echo '</div></div>'; // End layout
    echo '</main>';
    
    get_footer();
    exit; // 终止后续执行
}

$page_id = get_queried_object_id();

// 表单提交处理
if (isset($_POST['zib_report_submit']) && isset($_POST['zib_report_nonce'])) {
    if (!$is_logged_in) {
        $error_msg = '请先登录后再提交。';
    } elseif (wp_verify_nonce($_POST['zib_report_nonce'], 'zib_report_action')) {
        $report_title = sanitize_text_field($_POST['report_title']);
        $report_link  = esc_url_raw($_POST['report_link']);
        $report_type  = isset($_POST['report_type']) ? sanitize_text_field($_POST['report_type']) : '';

        if ($report_title && $report_link && $report_type) {
            global $wpdb;
            // 简单的防刷检测
            $exists = $wpdb->get_var($wpdb->prepare(
                "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_author = %d AND post_type = 'zib_report' AND post_date > %s",
                $report_title, $current_user_id, date('Y-m-d H:i:s', time() - 60)
            ));

            if (!$exists) {
                $post_data = array(
                    'post_title'  => $report_title,
                    'post_type'   => 'zib_report',
                    'post_status' => 'publish',
                    'post_author' => $current_user_id,
                );
                $post_id = wp_insert_post($post_data);

                if ($post_id) {
                    update_post_meta($post_id, 'zib_report_link', $report_link);
                    update_post_meta($post_id, 'zib_report_type', $report_type);
                    update_post_meta($post_id, 'zib_report_status', '0');

                    $redirect_url = add_query_arg('report_status', 'success', get_permalink($page_id));
                    
                    if (!headers_sent()) {
                        wp_safe_redirect($redirect_url);
                        exit;
                    } else {
                        echo '<script>window.location.href="' . esc_url($redirect_url) . '";</script>';
                        exit;
                    }
                }
            } else {
                $error_msg = '您提交得太快或内容重复,请稍后再试。';
            }
        } else {
            $error_msg = '请选择反馈类型,并填写完整的标题和链接。';
        }
    }
}

// 开始输出页面
get_header();

$header_style    = function_exists('zib_get_page_header_style') ? zib_get_page_header_style() : 1;
$content_style   = function_exists('zib_get_page_content_style') ? zib_get_page_content_style() : '';
$container_class = 'container';
$container_class .= $content_style ? ' page-content-' . $content_style : '';

$msg_html = '';
if (isset($_GET['report_status']) && $_GET['report_status'] == 'success') {
    $msg_html = '<div class="alert alert-success">提交成功!感谢反馈,我们会尽快处理。</div>';
}
if (isset($error_msg)) {
    $msg_html = '<div class="alert alert-danger">' . $error_msg . '</div>';
}

// CSS 样式 (保持原有样式)
?>
<style>
    .zib-widget-box { background: var(--main-bg-color); border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
    .zib-widget-body { padding: 20px; }
    .report-month-group { margin-bottom: 20px; border: 1px solid var(--main-border-color); border-radius: 8px; overflow: hidden; transition: 0.3s; background: var(--main-bg-color);}
    .report-month-group:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
    .report-month-header { padding: 15px 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; border-bottom: 1px solid transparent; transition:0.2s;}
    .report-month-header:hover { background: var(--muted-bg-color); }
    .report-month-header h3 { margin: 0; font-size: 15px; font-weight: bold; color: var(--main-color); }
    .report-month-header .count { font-size: 12px; color: var(--muted-color); margin-left: 10px; font-weight: normal; }
    .report-month-body { display: none; padding: 0; background: var(--main-bg-color); border-top: 1px solid var(--main-border-color); }
    .report-month-group.active .report-month-header { background: var(--muted-bg-color); border-bottom-color: var(--main-border-color); }
    .toggle-icon { transition: transform 0.3s; color: var(--muted-color); }
    .report-month-group.active .toggle-icon { transform: rotate(180deg); }
    .report-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
    .report-table tr { transition: 0.2s; }
    .report-table tr:hover { background: var(--muted-bg-color); }
    .report-table th, .report-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--main-border-color); font-size: 14px; vertical-align: middle; color: var(--main-color); }
    .report-table tr:last-child td { border-bottom: none; }
    .day-col { width: 85px; color: var(--muted-color); font-family: monospace; font-size: 13px; }
    .status-col { width: 90px; text-align: center; }
    .action-col { width: 140px; text-align: right; }
    .title-col { width: auto; }
    .title-col a { color: var(--main-color); }
    .title-col a:hover { color: var(--focus-color); }
    .title-col a.text-ellipsis { display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .action-btn-group { display: flex; justify-content: flex-end; gap: 5px; }
    .but.sm { padding: 4px 10px; font-size: 12px; line-height: 1.5; min-width: 50px; text-align: center;}
    .type-tag { font-size: 12px; padding: 2px 6px; border-radius: 4px; margin-right: 5px; background: var(--muted-border-color); color: var(--muted-color); font-weight: normal; vertical-align: middle;}
    .my-reports-section { border: 1px dashed var(--main-color); background: rgba(128, 128, 128, 0.05); }
    .my-reports-section .report-month-header { background: transparent; }
    @media screen and (max-width: 768px) {
        .report-table th, .report-table td { padding: 10px 5px; }
        .day-col { width: 50px; font-size: 12px; }
        .status-col { width: 70px; }
        .action-col { width: 100px; }
        .but.sm { padding: 2px 5px; min-width: auto; }
        .badg { padding: 2px 5px; font-size: 12px; min-width: auto !important; }
    }
</style>

<main class="<?php echo $container_class; ?>">
    <div class="content-wrap">
        <div class="content-layout">

            <article class="article page-article main-bg theme-box box-body radius8 main-shadow">

                <div class="wp-posts-content">
                    <?php echo $msg_html; ?>

                    <div class="zib-widget-box" style="border:1px dashed var(--main-border-color)">
                        <div class="zib-widget-body">
                            <h4 class="title-h4" style="margin-bottom: 15px"><i class="fa fa-pencil-square-o"></i> 提交失效资源</h4>

                            <form method="post" action="">
                                <?php wp_nonce_field('zib_report_action', 'zib_report_nonce'); ?>
                                <div class="row">
                                    <div class="col-sm-5"><div class="form-group"><input type="text" class="form-control" name="report_title" placeholder="资源名称 / 文章标题 (必填)" required></div></div>
                                    <div class="col-sm-3">
                                        <div class="form-group">
                                            <select class="form-control" name="report_type">
                                                <option value="">选择类型</option>
                                                <option value="资源失效">资源失效</option>
                                                <option value="音频损坏">音频损坏</option>
                                                <option value="资源错误">资源错误</option>
                                                <option value="其他问题">其他问题</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-sm-4"><div class="form-group"><input type="url" class="form-control" name="report_link" placeholder="文章链接 / 资源地址 (必填)" required></div></div>
                                </div>

                                <div class="text-right"><button type="submit" name="zib_report_submit" class="but c-blue"><i class="fa fa-paper-plane"></i> 提交</button></div>
                            </form>

                            <?php if (!$is_logged_in): ?>
                            <div class="text-center" style="padding: 20px 0"><p>请登录后提交反馈</p><a href="javascript:;" class="signin-loader but c-blue">登录/注册</a></div>
                            <?php endif; ?>
                        </div>
                    </div>

                    <?php
                    // 我的反馈记录
                    $my_paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                    $my_args  = array('post_type' => 'zib_report', 'post_status' => 'publish', 'author' => $current_user_id, 'posts_per_page' => 10, 'paged' => $my_paged);
                    $my_query = new WP_Query($my_args);
                    if ($my_query->have_posts()):
                    ?>
                    <div class="report-month-group my-reports-section">
                        <div class="report-month-header">
                            <div><h3 style="color:var(--main-color)"><i class="fa fa-user-circle-o"></i> 我的反馈记录 <span class="count">(点击展开)</span></h3></div><i class="fa fa-angle-down toggle-icon"></i>
                        </div>
                        <div class="report-month-body">
                            <table class="report-table">
                                <thead><tr><th class="day-col">日期</th><th class="title-col">资源标题</th><th class="status-col">状态</th><?php if (current_user_can('manage_options')) echo '<th class="action-col" style="text-align:center">操作</th>'; ?></tr></thead>
                                <tbody>
                                    <?php
                                    while ($my_query->have_posts()) : $my_query->the_post();
                                        $status   = get_post_meta(get_the_ID(), 'zib_report_status', true);
                                        $link     = get_post_meta(get_the_ID(), 'zib_report_link', true);
                                        $type     = get_post_meta(get_the_ID(), 'zib_report_type', true);
                                        $is_fixed = ($status == '1');
                                    ?>
                                    <tr id="my-report-row-<?php echo get_the_ID(); ?>">
                                        <td class="day-col"><?php echo get_the_date('m-d'); ?></td>
                                        <td class="title-col"><?php if ($type) echo '<span class="type-tag">' . $type . '</span>'; ?><a href="<?php echo $link; ?>" target="_blank" class="text-ellipsis"><?php the_title(); ?></a></td>
                                        <td class="status-col"><?php echo $is_fixed ? '<span class="badg c-green">已修复</span>' : '<span class="badg c-red">待修复</span>'; ?></td>
                                        <?php if (current_user_can('manage_options')): ?>
                                        <td class="action-col" style="text-align: center"><div class="action-btn-group" style="justify-content: center"><button class="but c-red sm delete-btn" data-id="<?php echo get_the_ID(); ?>">删除</button></div></td>
                                        <?php endif; ?>
                                    </tr>
                                    <?php endwhile; wp_reset_postdata(); ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <?php endif; ?>

                    <h4 class="title-h4" style="margin-top:40px"><i class="fa fa-history"></i> 全部修复记录</h4>
                    <?php
                    global $wpdb;
                    $months_per_page = 5;
                    $paged           = (get_query_var('paged')) ? get_query_var('paged') : 1;
                    $offset          = ($paged - 1) * $months_per_page;

                    $sql_months = "SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month FROM $wpdb->posts WHERE post_type = 'zib_report' AND post_status = 'publish' ORDER BY post_date DESC LIMIT $offset, $months_per_page";
                    $months     = $wpdb->get_results($sql_months);

                    $sql_count    = "SELECT COUNT(DISTINCT DATE_FORMAT(post_date, '%Y-%m')) FROM $wpdb->posts WHERE post_type = 'zib_report' AND post_status = 'publish'";
                    $total_months = $wpdb->get_var($sql_count);
                    $total_pages  = ceil($total_months / $months_per_page);

                    if ($months) {
                        $is_first_month = true;
                        foreach ($months as $m) {
                            $year         = $m->year;
                            $month        = $m->month;
                            $active_class = $is_first_month ? 'active' : '';
                            $count_query  = new WP_Query(array('post_type' => 'zib_report', 'post_status' => 'publish', 'date_query' => array(array('year' => $year, 'month' => $month)), 'fields' => 'ids'));
                            $month_count  = $count_query->found_posts;

                            echo '<div class="report-month-group ' . $active_class . '"><div class="report-month-header"><div><h3>' . $year . '年' . $month . '月 <span class="count">(' . $month_count . '条)</span></h3></div><i class="fa fa-angle-down toggle-icon"></i></div>';
                            echo '<div class="report-month-body" style="' . ($is_first_month ? 'display:block' : '') . '"><table class="report-table"><tbody>';

                            $args        = array('post_type' => 'zib_report', 'posts_per_page' => -1, 'post_status' => 'publish', 'date_query' => array(array('year' => $year, 'month' => $month)), 'orderby' => 'date', 'order' => 'DESC');
                            $month_posts = new WP_Query($args);

                            if ($month_posts->have_posts()) {
                                while ($month_posts->have_posts()) {
                                    $month_posts->the_post();
                                    $pid      = get_the_ID();
                                    $status   = get_post_meta($pid, 'zib_report_status', true);
                                    $link     = get_post_meta($pid, 'zib_report_link', true);
                                    $type     = get_post_meta($pid, 'zib_report_type', true);
                                    $is_fixed = ($status == '1');
                                    $day      = get_the_date('d') . '日';
                                    echo '<tr id="report-row-' . $pid . '"><td class="day-col">' . $day . '</td><td class="title-col">';
                                    if ($type) echo '<span class="type-tag">' . $type . '</span>';
                                    echo '<a href="' . $link . '" target="_blank" class="text-ellipsis">' . get_the_title() . '</a></td>';
                                    echo '<td class="status-col">';
                                    if ($is_fixed) echo '<span class="badg c-green" style="min-width:60px">已修复</span>'; else echo '<span class="badg c-red" id="status-badge-' . $pid . '" style="min-width:60px">待修复</span>';
                                    echo '</td>';
                                    if (current_user_can('manage_options')) {
                                        echo '<td class="action-col"><div class="action-btn-group">';
                                        if (!$is_fixed) echo '<button class="but c-blue sm fix-btn" data-id="' . $pid . '">修复</button>'; else echo '<span class="c-green" style="font-size:12px;line-height:2;margin-right:5px"><i class="fa fa-check"></i></span>';
                                        echo '<button class="but c-red sm delete-btn" data-id="' . $pid . '">删除</button></div></td>';
                                    }
                                    echo '</tr>';
                                }
                                wp_reset_postdata();
                            }
                            echo '</tbody></table></div></div>';
                            $is_first_month = false;
                        }
                        if ($total_pages > 1) {
                            echo '<div class="pagenav text-center ajax-pag" style="margin-top:20px">' . paginate_links(array('base' => get_pagenum_link(1) . '%_%', 'format' => 'page/%#%', 'current' => $paged, 'total' => $total_pages, 'prev_text' => '<i class="fa fa-angle-left"></i>', 'next_text' => '<i class="fa fa-angle-right"></i>', 'type' => 'list')) . '</div>';
                        }
                    } else {
                        echo '<div class="theme-box box-body radius8 main-shadow text-center"><p>暂无记录</p></div>';
                    }
                    ?>
                </div>
            </article>
        </div>
    </div>
</main>

<?php
// 生成 Nonce 供 JS 使用
$ajax_nonce = wp_create_nonce('zib_report_manage_nonce');

// 脚本部分
echo '<script>
(function($){
    $(document).on("click", ".report-month-header", function(){
        var $group = $(this).parent();
        var $body = $group.find(".report-month-body");
        $group.toggleClass("active");
        $body.slideToggle(300);
    });
    
    $(document).on("click", ".fix-btn", function(){
        var btn = this;
        var reportId = $(btn).attr("data-id");
        var $btn = $(btn);
        $btn.text("...").prop("disabled", true);
        $.ajax({
            url: "' . admin_url('admin-ajax.php') . '",
            type: "POST",
            dataType: "json", 
            data: { 
                action: "zib_fix_report", 
                report_id: reportId,
                security: "' . $ajax_nonce . '" 
            },
            success: function(response) {
                if(response.success) {
                    $("#status-badge-" + reportId).removeClass("c-red").addClass("c-green").text("已修复");
                    $btn.replaceWith("<span class=\"c-green\" style=\"font-size:12px;line-height:2;margin-right:5px\"><i class=\"fa fa-check\"></i></span>");
                } else { 
                    alert("操作失败:" + (response.data || "未知错误")); 
                    $btn.text("修复").prop("disabled", false); 
                }
            },
            error: function() {
                alert("网络请求失败");
                $btn.text("修复").prop("disabled", false);
            }
        });
    });

    $(document).on("click", ".delete-btn", function(){
        if(!confirm("确定要删除吗?此操作不可恢复。")) return;
        var btn = this;
        var reportId = $(btn).attr("data-id");
        $.ajax({
            url: "' . admin_url('admin-ajax.php') . '",
            type: "POST",
            dataType: "json",
            data: { 
                action: "zib_delete_report", 
                report_id: reportId,
                security: "' . $ajax_nonce . '" 
            },
            success: function(response) {
                if(response.success) {
                    $("#report-row-" + reportId).fadeOut(300, function(){ $(this).remove(); });
                    $("#my-report-row-" + reportId).fadeOut(300, function(){ $(this).remove(); });
                } else { 
                    alert("删除失败:" + (response.data || "未知错误")); 
                }
            },
            error: function() {
                alert("网络请求失败");
            }
        });
    });
})(jQuery);
</script>';

get_footer();

定位:/wp-content/themes/zibll/func.php文件,没有这个文件自己创建一个,记得加上php头,要不然会报错,将下面的代码丢里面!

/**
 * Zibll工具箱 - 失效反馈功能模块
 */
// 1. 注册自定义文章类型 (CPT)
add_action('init', 'zib_report_register_cpt');
if (!function_exists('zib_report_register_cpt')) {
    function zib_report_register_cpt() {
        $labels = array(
            'name'               => '失效反馈',
            'singular_name'      => '反馈',
            'menu_name'          => '失效反馈',
            'name_admin_bar'     => '失效反馈',
            'add_new'            => '新建反馈',
            'add_new_item'       => '新建反馈',
            'new_item'           => '新反馈',
            'edit_item'          => '编辑反馈',
            'view_item'          => '查看反馈',
            'all_items'          => '所有反馈',
            'search_items'       => '搜索反馈',
            'not_found'          => '暂无反馈',
            'not_found_in_trash' => '回收站中没有反馈',
        );
        $args = array(
            'labels'             => $labels,
            'public'             => false, 
            'publicly_queryable' => false,
            'show_ui'            => true,  
            'show_in_menu'       => true,
            'query_var'          => true,
            'rewrite'            => array('slug' => 'zib_report'),
            'capability_type'    => 'post',
            'has_archive'        => false,
            'hierarchical'       => false,
            'menu_position'      => null,
            'menu_icon'          => 'dashicons-warning',
            'supports'           => array('title', 'author', 'custom-fields'),
        );
        register_post_type('zib_report', $args);
    }
}
// 2. 处理 AJAX 请求:修复与删除
add_action('wp_ajax_zib_fix_report', 'zib_ajax_fix_report_handler');
if (!function_exists('zib_ajax_fix_report_handler')) {
    function zib_ajax_fix_report_handler() {
        check_ajax_referer('zib_report_manage_nonce', 'security');
        if (!current_user_can('manage_options')) {
            wp_send_json_error('权限不足');
        }
        $report_id = isset($_POST['report_id']) ? intval($_POST['report_id']) : 0;
        if ($report_id && get_post_type($report_id) === 'zib_report') {
            update_post_meta($report_id, 'zib_report_status', '1');
            wp_send_json_success(array('msg' => '已标记为修复'));
        } else {
            wp_send_json_error('无效的反馈ID或类型错误');
        }
    }
}
add_action('wp_ajax_zib_delete_report', 'zib_ajax_delete_report_handler');
if (!function_exists('zib_ajax_delete_report_handler')) {
    function zib_ajax_delete_report_handler() {
        check_ajax_referer('zib_report_manage_nonce', 'security');
        if (!current_user_can('manage_options')) {
            wp_send_json_error('权限不足');
        }
        $report_id = isset($_POST['report_id']) ? intval($_POST['report_id']) : 0;
        if ($report_id && get_post_type($report_id) === 'zib_report') {
            $result = wp_delete_post($report_id, true);
            if ($result) {
                wp_send_json_success(array('msg' => '删除成功'));
            } else {
                wp_send_json_error('数据库删除操作失败');
            }
        } else {
            wp_send_json_error('无效的ID或该记录不是反馈类型');
        }
    }
}
// 3. 后台列表优化
add_filter('manage_zib_report_posts_columns', function ($columns) {
    $new_columns = array(
        'cb'            => $columns['cb'],
        'title'         => '反馈标题',
        'report_type'   => '类型',
        'report_link'   => '失效链接',
        'report_status' => '状态',
        'author'        => '提交者',
        'date'          => $columns['date']
    );
    return $new_columns;
});
add_action('manage_zib_report_posts_custom_column', function ($column, $post_id) {
    switch ($column) {
        case 'report_type':
            echo get_post_meta($post_id, 'zib_report_type', true);
            break;
        case 'report_link':
            $link = get_post_meta($post_id, 'zib_report_link', true);
            echo '<a href="' . esc_url($link) . '" target="_blank">查看链接</a>';
            break;
        case 'report_status':
            $status = get_post_meta($post_id, 'zib_report_status', true);
            echo ($status == '1') ? '<span style="color:green">已修复</span>' : '<span style="color:red">待修复</span>';
            break;
    }
}, 10, 2);

部署页面

定位:WP后台–>>页面–>>新增页面–>>Zibll工具箱-资源失效提交页发布页面即可!

说明

我们要知道一个事,部署成功之后是默认让vip会员显示看到页面,如果部署vip会让开通会员,接下来我们来替换:pages文件的代码,如果想让所有人看到,教程如下!

我们首先找到下面的代码,下面的代码是只让vip显示该页面

// 原代码:同时检查是否登录 + 是否是VIP
if (!$is_logged_in || !function_exists('zib_get_user_vip_level') || !zib_get_user_vip_level($current_user_id)) {

然后我们下面的代码就是替换他的代码,也就是所有人可见的!

// 新代码:只检查是否登录
if (!$is_logged_in) {

替换完了之后就好了,不过pages文件代码里面还有一个是需要替换的,被替换的如下

echo '<p class="muted-color" style="font-size:15px; margin-bottom:40px;">此页面仅对 VIP 会员开放</p>';

替换成下面的代码

echo '<p class="muted-color" style="font-size:15px; margin-bottom:40px;">请登录后访问此页面</p>';

那么有人说了,用户提交失效,我想修改提交的失效需求,那么还是在pages文件代码里面搜:

<select class="form-control" name="report_type">

然后整个段你可以自己改一下文字,比如我下面的代码

<select class="form-control" name="report_type">
    <option value="">选择类型</option>
    <option value="无法播放">无法播放</option>
    <option value="画质模糊">画质模糊</option>
    <option value="声画不同步">声画不同步</option>
    <option value="字幕缺失">字幕缺失</option>
</select>

文字自己修改即可!

© 版权声明
THE END
喜欢就支持一下吧
点赞14 分享
📝评论 抢沙发

请登录后发表评论

    暂无评论内容

    评论区底部背景