IP 定位未来天气版 固定地区版 IP 定位版
20260205090407_6983ec871f11d.png 20260205090351_6983ec77884fd.jpg 20260205090351_6983ec77884fd.jpg

一. 天气预报插件文件结构

***/
plugin/ 插件目录
└── weather/ 天气插件目录
    ├── api.php                         (异步加载接口)
    ├── weather_*.json                  (固定地区版 缓存文件)
    ├── weather_ip_*.json               (IP 定位版 缓存文件)
    ├── weather_widget.php              (固定地区版)
    ├── weather_widget_ip.php           (IP 定位版)
    ├── weather_widget_ip_with_days.php (IP 定位未来天气版)
    ├── weather_functions.php           (天气插件函数)
    └── weather_styles.css              (天气插件样式)

二. 页面引入方式

  • 固定地区版
<?php include './plugin/weather/weather_widget.php'; ?>
  • IP 定位版
<?php include './plugin/weather/weather_widget_ip.php'; ?>
  • IP 定位未来天气版
<?php include './plugin/weather/weather_widget_ip_with_days.php'; ?>

出处:https://xblog.itxgo.com/article.php?id=25
版权:本文采用 CC BY-NC-SA 4.0 协议,完整转载请注明来源。