可锐资源网

技术资源分享平台,提供编程学习、网站建设、脚本开发教程

这7款非常好用的Windows 软件,工作效率直接起飞

作为程序员,天天跟电脑和代码打交道,有时候就需要一些工具来提升我们的效率。下面介绍一些 Windows 系统上发现的一些好用的工具,工作效率up。

ServBay - 本地Web开发环境管理工具

啥都别说了,ServBay必须排在第一个。作为Web开发者,这个工具可太必要了。

对于Web开发者来说,在本地电脑上配置和管理Python、Node.jsPHP、MySQL、Nginx等开发环境是一件比较繁琐的事。ServBay是一个集成了这些常用服务的工具,它提供了一个图形化界面,让你能够方便地启动、停止和切换不同版本的服务,不仅如此,而且它还支持SSL证书,在开发过程中省去了大量手动配置的时间,这样我就可以更专注于开发工作本身。

laravel admin 1.8 模态框 select联动的问题

客户要求php的,原本打算layui + laravel,各种原因还是选了 la admin。

之前试了 la admin2.0的版本,竟然没有权限管理

系统后台有个手动充值表单,需要弹窗,结果选择商品套餐不能联动,找了github上的issue帖子,也没搞定。

wordpress一个产品模块的插件(wordpress产品展示插件)

<?php
/**
 * @package 产品模块22
 * @version 1.0.0
 * Plugin Name: Schoolo_cn 产品自定义字段模块
 * Plugin URI: http://wordpress.org/plugins/schoolo-product/
 * Description: 外贸站产品模块,包含产品自定义文章类型、元框字段、分类法及扩展功能
 * Author: 小胖同学
 * Version: 1.0.0
 * Author URI: https://ai.schoolo.cn
 */

if (!defined('ABSPATH')) {
    exit; // 禁止直接访问
}

// 定义插件常量
define('SCHOOLO_PRODUCT_VERSION', '1.0.0');
define('SCHOOLO_PRODUCT_DIR', plugin_dir_path(__FILE__));
define('SCHOOLO_PRODUCT_URL', plugin_dir_url(__FILE__));

/**
 * 安全注册产品自定义文章类型
 */
add_action('init', 'schoolo_register_product_post_type', 10);
function schoolo_register_product_post_type() {
    if (post_type_exists('product')) {
        error_log('警告:product 文章类型已存在,注册跳过');
        return;
    }

    $labels = [
        'name'                  => _x('产品', 'post type general name', 'schoolo-product'),
        'singular_name'         => _x('产品', 'post type singular name', 'schoolo-product'),
        'menu_name'             => __('产品', 'schoolo-product'),
        'all_items'             => __('所有产品', 'schoolo-product'),
        'add_new'               => __('添加新产品', 'schoolo-product'),
        'add_new_item'          => __('新建产品', 'schoolo-product'),
        'edit_item'             => __('编辑产品', 'schoolo-product'),
        'view_item'             => __('查看产品', 'schoolo-product'),
        'search_items'          => __('搜索产品', 'schoolo-product'),
        'not_found'             => __('未找到产品', 'schoolo-product'),
        'not_found_in_trash'    => __('回收站无产品', 'schoolo-product'),
        'featured_image'        => __('产品封面图', 'schoolo-product'),
        'set_featured_image'    => __('设置封面图', 'schoolo-product'),
    ];

    $args = [
        'labels'                => $labels,
        'public'                => true,
        'publicly_queryable'    => true,
        'show_ui'               => true,
        'show_in_menu'          => true,
        'show_in_admin_bar'     => true,
        'query_var'             => true,
        'rewrite'               => ['slug' => 'product', 'with_front' => false],
        'capability_type'       => 'post',
        'has_archive'           => true,
        'hierarchical'          => false,
        'menu_position'         => 5,
        'menu_icon'             => 'dashicons-products',
       // 'supports'              => ['title', 'editor', 'thumbnail', 'excerpt', 'custom-fields'],
        'supports'              => array( 'title', 'editor', 'author','excerpt', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields'/* , 'page-attributes' */, 'post-formats', ),
        'show_in_rest'          => true,
        'map_meta_cap'          => true,
        'taxonomies'            => ['product_category', 'product_tag'],
    ];

    $result = register_post_type('product', $args);
    if (is_wp_error($result)) {
        error_log('产品文章类型注册失败:' . $result->get_error_message());
    } else {
        error_log('产品文章类型注册成功');
    }
}

/**
 * 注册产品分类法
 */
add_action('init', 'schoolo_register_product_taxonomies', 10);
function schoolo_register_product_taxonomies() {
    // 注册产品分类
    if (!taxonomy_exists('product_category')) {
        $labels = [
            'name'              => _x('产品分类', 'taxonomy general name', 'schoolo-product'),
            'singular_name'     => _x('分类', 'taxonomy singular name', 'schoolo-product'),
            'search_items'      => __('搜索分类', 'schoolo-product'),
            'all_items'         => __('所有分类', 'schoolo-product'),
            'parent_item'       => __('父级分类', 'schoolo-product'),
            'menu_name'         => __('产品分类', 'schoolo-product'),
        ];

        register_taxonomy('product_category', ['product'], [
            'labels'         => $labels,
            'hierarchical'   => true,
            'show_ui'        => true,
            'show_in_rest'   => true,
            'rewrite'        => ['slug' => 'product-category'],
        ]);
    }

    // 注册产品标签
    if (!taxonomy_exists('product_tag')) {
        $labels = [
            'name'              => _x('产品标签', 'taxonomy general name', 'schoolo-product'),
            'singular_name'     => _x('标签', 'taxonomy singular name', 'schoolo-product'),
            'search_items'      => __('搜索标签', 'schoolo-product'),
            'all_items'         => __('所有标签', 'schoolo-product'),
            'menu_name'         => __('产品标签', 'schoolo-product'),
        ];

        register_taxonomy('product_tag', ['product'], [
            'labels'         => $labels,
            'hierarchical'   => false,
            'show_ui'        => true,
            'show_in_rest'   => true,
            'show_in_nav_menus' => true,
            'show_admin_column' => true, // 可选:在文章列表显示分类列
            'rewrite'        => ['slug' => 'product-tag'],
        ]);
    }
}

/**
 * 加载 CMB2 插件(若未安装)
 */
if (!class_exists('CMB2')) {
    require_once SCHOOLO_PRODUCT_DIR . 'includes/cmb2/init.php'; // 假设 CMB2 路径正确
}

/**
 * 产品元框字段(基于 CMB2)
 */
add_action('cmb2_admin_init', 'schoolo_product_metaboxes');
function schoolo_product_metaboxes() {
    $prefix = 'schoolo_';

    // 主元框:产品设置
    $cmb_product = new_cmb2_box([
        'id'            => $prefix . 'product_metabox',
        'title'         => __('产品设置', 'schoolo-product'),
        'object_types'  => ['product'],
        'context'       => 'normal',
        'priority'      => 'high',
    ]);

    // 产品视频(外部嵌入)
    $cmb_product->add_field([
        'name'        => __('产品视频 (外部调用)', 'schoolo-product'),
        'desc'        => __('输入视频页面地址(如YouTube/Vimeo)', 'schoolo-product'),
        'id'          => $prefix . 'video_embed',
        'type'        => 'oembed',
    ]);

    // 产品视频(本地上传)
    $cmb_product->add_field([
        'name'        => __('产品视频 (本地上传)', 'schoolo-product'),
        'desc'        => __('上传视频或输入URL', 'schoolo-product'),
        'id'          => $prefix . 'video_url',
        'type'        => 'file',
        'query_args'  => ['type' => 'video'],
        'text'        => ['add_upload_file_text' => '添加视频'],
    ]);


    $cmb_product->add_field( array(
        'name' => esc_html__( '浏览次数', 'wppopMetabox' ),
        'desc' => __( '统计显示当前文章的浏览量, 支持自定义修改', 'wppopMetabox' ),
        'id'   => 'views',
        'type' => 'text_small',
    ) );

    // 视频封面图片
    $cmb_product->add_field([
        'name'        => __('视频封面图片', 'schoolo-product'),
        'desc'        => __('设置视频封面', 'schoolo-product'),
        'id'          => $prefix . 'video_thumb',
        'type'        => 'file',
        'query_args'  => ['type' => 'image'],
        'text'        => ['add_upload_file_text' => '添加图片'],
    ]);

    // 多图上传
    $cmb_product->add_field([
        'name'         => __('产品图片', 'schoolo-product'),
        'desc'         => __('上传多张图片(切换展示)', 'schoolo-product'),
        'id'           => $prefix . 'product_images',
        'type'         => 'file_list',
        'query_args'   => ['type' => 'image'],
        'preview_size' => [100, 100],
        'text'         => [
            'add_upload_files_text' => '添加图片',
            'remove_image_text'     => '移除图片',
        ],
    ]);

    // 产品参数(短描述)
    $cmb_product->add_field([
        'name'        => __('产品参数', 'schoolo-product'),
        'desc'        => __('自定义参数内容(显示于图片右侧)', 'schoolo-product'),
        'id'          => $prefix . 'product_params',
        'type'        => 'wysiwyg',
        'options'     => ['textarea_rows' => 5],
    ]);

    $cmb_product->add_field([
        'name'        => __('购买链接', 'schoolo-product'),
        'desc'        => __('输入电商平台链接', 'schoolo-product'),
        'id'          => $prefix . 'purchase_url',
        'type'        => 'text_url',
    ]);

    // 热门产品标记
    $cmb_product->add_field([
        'name'        => __('热门产品', 'schoolo-product'),
        'desc'        => __('勾选后显示于热门产品列表', 'schoolo-product'),
        'id'          => $prefix . 'is_hot',
        'type'        => 'checkbox',
    ]);

    // 可重复内容模块(选项卡)
    $cmb_tabs = new_cmb2_box([
        'id'            => $prefix . 'product_tabs',
        'title'         => __('自定义内容模块', 'schoolo-product'),
        'object_types'  => ['product'],
        'context'       => 'normal',
    ]);

    $group_id = $cmb_tabs->add_field([
        'id'          => $prefix . 'tabs_group',
        'type'        => 'group',
        'description' => __('添加可切换内容模块(建议不超过6个)', 'schoolo-product'),
        'options'     => [
            'group_title'   => __('模块 {#}', 'schoolo-product'),
            'add_button'    => __('【+】添加模块', 'schoolo-product'),
            'remove_button' => __('移除模块', 'schoolo-product'),
            'sortable'      => true,
        ],
    ]);

    $cmb_tabs->add_group_field($group_id, [
        'name'        => __('模块标题', 'schoolo-product'),
        'id'          => 'tab_title',
        'type'        => 'text',
    ]);

    $cmb_tabs->add_group_field($group_id, [
        'name'        => __('模块内容', 'schoolo-product'),
        'id'          => 'tab_content',
        'type'        => 'wysiwyg',
        'options'     => ['textarea_rows' => 8],
    ]);
}

/**
 * 加载插件文本域(多语言支持)
 */
add_action('plugins_loaded', 'schoolo_product_load_textdomain');
function schoolo_product_load_textdomain() {
    load_plugin_textdomain('schoolo-product', false, dirname(plugin_basename(__FILE__)) . '/languages/');
}
?>

询盘你半天才看到?WordPress也能实现WhatsApp+TG+邮件三重提醒

“哥,我有时候在外面看展,结果客户填了表我根本没及时看到,错过了两个急单。”

一个做厨房刀具出口的客户很懊恼地说。

我看了他站,是用 Contact Form 7 做的表单,只发邮件通知。但他邮箱还不是 Gmail,是那种老旧国内邮箱,经常进垃圾箱

我说:“你得搞个‘多通道提醒系统’,表单一提交,

Wordpress建站教程:给导航栏添加默认搜索框

继续分享wordpress建站教程。之前悦然wordpress建站在帮客户做外贸建站时遇到一个需求,他们想在导航栏上显示传统的搜索框,而不是那种弹出式的搜索框,而我使用的那个wordpress主题默认都使用的是弹出式搜索框,现在绝大多数主题应该都是用的这种,一般来说这没什么问题,弹出式的搜索框效果还更好一些。但是用户需求高于一切,能实现肯定要尽量去实现的。

解决织梦5.7发布文章出错的问题(织梦怎样实现文件上传)

解决织梦5.7发布文章时出错的问题: Call to undefined function dede_htmlspecialchars()

2015年6月18日更新的新版本的织梦5.7,为了兼容php5.4+,修改了common.func.php,可能有些模板也改动过这个文件,这样会导致在安装模板时,common.fuc.php文件被覆盖,从而在发布文章时,编辑框的位置出现“Call to undefined function dede_htmlspecialchars()”这样的错误提示。

php手把手教你做网站(十七)vue实现提示弹窗效果,ie不支持vue

我是把弹窗的html都写在了页面app里边。

1、html代码

<div class="layui-body"  id="app">
  <div  ><button  @click="queren">显示确认框</button><button  @click="qshanchu">显示删除框</button></div>
  <div class='zzc none'  :class="{'nonone':showzzc==1}">
  <div class='confir' v-show="showts==1">
    <h3>温馨提示</h3>
	<p>确认要删除吗?</p>
	<div class='del-btn-item'>
	  <dl>
	    <dd>
		  <button type='button' class='confire_btn_no'   @click="hidetc">取消</button>
		  <button type='button' class='confire_btn_yes' @click="isdelc">确认</button>
	    </dd>
	  </dl>
    </div>
  </div>
  <div class='confir' v-show="showts==2">
    <h3>温馨提示</h3>
    <p>{{tis}}</p>
    <div class='del-btn-item'>
      <dl>
	    <dd>
		  <button type='button' class='confire_btn_yes_full confire_btn_yes' @click="hidetc">确认</button>
	    </dd>
	  </dl>
    </div>
  </div>
</div>
</div>
<< 1 >>
控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言